Last active
July 17, 2018 19:57
-
-
Save sgelob/0cd92a3e72947e7adf82d1bc927f83e1 to your computer and use it in GitHub Desktop.
Measuring the Critical Rendering Path via GTM an Google Analytics
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
<script type="text/javascript"> | |
// https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp | |
(function() { | |
var t = window.performance.timing, | |
interactive = t.domInteractive - t.domLoading, | |
dcl = t.domContentLoadedEventStart - t.domLoading, | |
complete = t.domComplete - t.domLoading; | |
dataLayer.push({ | |
"event": "measuringCRP", | |
"interactive": interactive, | |
"DCL": dcl, | |
"complete": complete | |
}); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developers.google.com/web/fundamentals/performance/critical-rendering-path/measure-crp