Skip to content

Commit

Permalink
fix gtag script
Browse files Browse the repository at this point in the history
  • Loading branch information
remvn committed Sep 23, 2024
1 parent fe6d6ca commit 1ea618f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions layouts/partials/analytics.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Partytown Setup -->
<script type="text/javascript">
partytown = {
forward: ["dataLayer.push"],
forward: ["dataLayer.push", "fbq"],
};
</script>
<script type="text/javascript">
Expand All @@ -12,14 +12,13 @@

<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-D3VB7YFCTH"
type="text/partytown"
src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.gtmID }}"
></script>

<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
window.gtag = function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', "{{ .Site.Params.gtmID }}");
gtag('config', '{{ .Site.Params.gtmID }}');
</script>

0 comments on commit 1ea618f

Please sign in to comment.