Last active
August 19, 2021 14:44
-
-
Save inetbiz/f1db85dcff1665b6a0c273795804ad7e to your computer and use it in GitHub Desktop.
Google Tag - User Timings
This file contains 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
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-xx"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('set',{'content_group1':'{{page.title}}'}); | |
if (window.performance) { | |
var timeSincePageLoad = Math.round(performance.now()); | |
gtag('event', 'timing_complete', { | |
'name': 'load', | |
'value': timeSincePageLoad, | |
'event_category': 'Page Render Time' | |
}); | |
} gtag('config', 'UA-xxxxxxx-xx'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment