42 ms·
Using GA isn't bad because there are two ways to run it. First is when GA script is on <head> section. This is mostly popular, but making CWV scores little bit
by mobilio 5y ago
Using GA isn't bad because there are two ways to run it.
First is when GA script is on <head> section. This is mostly popular, but making CWV scores little bit low.
Second is when GA script is anywhere on page, but not on <head>. Like before </body> or in <body>. This doesn't hurt your CWV scores.
- tyingq 5y agoThey are using your latter example, here's the page: https://blog.simpleanalytics.com/with-ga-script https://blog.simpleanalytics.com/with-ga-script It is hurting the score. The GA script is NOT in the <head>.
- mobilio 5y agoYes - 91 on mobile. Because fonts, not because GTM.
- spicybright 5y agothat's kind of weird, I would think you'd want to measure things like time to dom load, if someone clicks off before that, etc. Maybe for performance reasons?
- mobilio 5y agoYes - putting on head can measure DOM loading and interactions as quick as they happens. But have performance hit - Webkit (Safari, Chrome, etc) doesn't show even single pixel on screen until they load all resources in head. And another bad news - HTTP partition cache for Safari and Chrome. Putting in body - you can not catch all interactions, but won't stop rendering. Everything is an compromise...
- spicybright 5y agoWowie, not a single pixel? So I'm not crazy firefox seems faster than chrome?
- mobilio 5y agoSort of... But Chrome has much better JS engine - V8.
- Gustomaximus 5y agoAlso you can run from cache and it also solves this performance score issue E.g. https://docs.wp-rocket.me/article/1103-google-tracking-add-on https://docs.wp-rocket.me/article/1103-google-tracking-add-o...
- mobilio 5y agoOr use lightweight alternative: https://github.com/jehna/ga-lite https://github.com/jehna/ga-lite