gatsby-plugin-baidu-analytics
Version:
baidu analytics for gatsby site
11 lines (9 loc) • 395 B
JavaScript
;
exports.onRouteUpdate = function (_ref) {
var _ref$location = _ref.location,
location = _ref$location === void 0 ? {} : _ref$location;
// Don't track while developing.
if (process.env.NODE_ENV === "production" && typeof _hmt === "function") {
window._hmt.push(["_trackPageview", "".concat(location.pathname).concat(location.search).concat(location.hash)]);
}
};