Skip to content

Commit

Permalink
🐛 [GA] Fix analytics script
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Jul 22, 2024
1 parent bea860c commit 4d53198
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/layouts/Page.astro
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ const {id, title = DEFAULT_TITLE} = Astro.props;
async
src="https://www.googletagmanager.com/gtag/js?id=G-4G2VKG5NK2"></script>
<script is:inline>
if (window.location.hostname === 'localhost') return;

window.dataLayer = window.dataLayer || [];

function gtag() {
dataLayer.push(arguments);
}

gtag('js', new Date());
gtag('config', 'G-4G2VKG5NK2');
if (window.location.hostname !== 'localhost') {
gtag('js', new Date());
gtag('config', 'G-4G2VKG5NK2');
}
</script>
</head>

Expand Down

0 comments on commit 4d53198

Please sign in to comment.