Skip to content

Commit b88df13

Browse files
committed
Fix Google Analytics implementation to match Google's exact format
1 parent 2d99ed0 commit b88df13

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

docs/javascripts/analytics.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
// Google tag (gtag.js)
1+
// Google tag (gtag.js) - Load the script first
2+
var script = document.createElement('script');
3+
script.async = true;
4+
script.src = 'https://www.googletagmanager.com/gtag/js?id=G-9JKSMSLNJ9';
5+
document.head.appendChild(script);
6+
7+
// Initialize gtag after script loads
28
window.dataLayer = window.dataLayer || [];
39
function gtag(){dataLayer.push(arguments);}
410
gtag('js', new Date());
5-
611
gtag('config', 'G-9JKSMSLNJ9');

0 commit comments

Comments
 (0)