Hacker News new | past | comments | ask | show | jobs | submit login

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.




They are using your latter example, here's the page: https://blog.simpleanalytics.com/with-ga-script

It is hurting the score. The GA script is NOT in the <head>.


Yes - 91 on mobile.

Because fonts, not because GTM.


Also 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-o...


Or use lightweight alternative: https://github.com/jehna/ga-lite


that'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?


Yes - 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...


Wowie, not a single pixel? So I'm not crazy firefox seems faster than chrome?


Sort of...

But Chrome has much better JS engine - V8.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: