Skip to content

Commit

Permalink
Update GA4 tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecarlisle committed Jun 17, 2023
1 parent 54c66a9 commit f5f9909
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
<link href="https://www.googletagmanager.com/gtm.js?id=GTM-5XHZVF" rel="preload" as="script">
<link rel="dns-prefetch" href="https://www.googletagmanager.com/" >

{%- if site.environment === 'production' -%}
<!-- Global site tag (gtag.js) - Google Analytics 4 -->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-5XHZVF');</script>
<!-- End Google Tag Manager -->
{%- if site.environment === "production" -%}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-70E1BWCFJ3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-70E1BWCFJ3');
</script>
{%- endif -%}

<meta charset="UTF-8">
Expand Down Expand Up @@ -81,11 +85,6 @@
{%- include "../includes/structuredData.njk" -%}
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5XHZVF" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<a href="#main-content" class="skiplink">Skip to Content</a>
<header class="primary">
<div class="wrapper">
Expand Down

0 comments on commit f5f9909

Please sign in to comment.