Skip to content

Commit 577b316

Browse files
authored
Merge pull request #273 from Codebrahma/add-analytics
update analytics config
2 parents 7686d77 + 24fce92 commit 577b316

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)