Skip to content

Commit 24fce92

Browse files
committed
fix(gatsby-browser.js): add analytics for inner routes
1 parent a2198d2 commit 24fce92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/gatsby-browser.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
*/
66

77
// You can delete this file if you're not using it
8+
exports.onPreRouteUpdate = ({ location }) => {
9+
if (window && typeof window.gtag === 'function') {
10+
window.gtag('config', 'UA-41862404-1', { page_path: location.pathname });
11+
}
12+
};

0 commit comments

Comments
 (0)