allow opting out of tracking.

This commit is contained in:
danfunk 2023-08-03 16:55:07 -04:00
parent c7ae9883bb
commit 9bcd924b5c
2 changed files with 7 additions and 17 deletions

View File

@ -54,16 +54,13 @@
document.head.appendChild(script);
}
/* This is the part where you call the above defined function and "calls back"
your code which gets executed after the script has loaded */
//REPLACE WITH YOUR GA TAG!
loadScriptAsync('https://www.googletagmanager.com/gtag/js?id=G-3Z83G8WLEK', function () {
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
//REPLACE WITH YOUR GA TAG!
gtag('config', 'G-3Z83G8WLEK', { 'anonymize_ip': true, cookie_flags: 'secure;samesite=none' });
});
<!-- Google Tag Manager -->
(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-NFMNL96Z');
<!-- End Google Tag Manager -->
{{ end }}
} else if (readCookie('cookie-notice-option')!='false'){

View File

@ -7,10 +7,3 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- 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-NFMNL96Z');</script>
<!-- End Google Tag Manager -->