Created
December 3, 2020 21:41
-
-
Save thyngster/50fbe3dfc84dc8b4e29b175084eaccca to your computer and use it in GitHub Desktop.
CloudFlare Analytics Snippet for GTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Cloudflare Web Analytics --> | |
<script> | |
(function(){ | |
var s, | |
r, | |
t; | |
r = false; | |
s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.src = 'https://static.cloudflareinsights.com/beacon.min.js'; | |
s.dataset.cfBeacon = '{"token": "{{PUTYOURSITETOKENHERE}}"}'; | |
s.defer = true; | |
s.onload = s.onreadystatechange = function() { | |
if ( !r && (!this.readyState || this.readyState == 'complete') ){ | |
r = true; | |
} | |
}; | |
t = document.getElementsByTagName('script')[0]; | |
t.parentNode.insertBefore(s, t); | |
})() | |
</script> | |
<!-- End Cloudflare Web Analytics --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment