Open millette opened 4 years ago
Good call.
I'm pretty sure I addressed this before, maybe the ga()
NOP is already hidden somewhere. I've seen many sites broken only because ga()
was failing when the site would work fine otherwise.
I also see some sites slowed down because of GA. There definitely needs a better way to manage this.
Don't use google analytics :-)
In fact, we could investigate other options by identifying what you really want to measure (only actionable stuff). After snowpack :p
+1
Meanwhile, we should add server-side logging, enough at least to compare with GA. See #148
New article on Plausible: https://freshman.tech/google-analytics-to-plausible/
About plausible: I'm not sure how many montlhy pageviews you have, say it's 500k. That adds up to 300$ CAD a year according to https://plausible.io/#pricing if paid yearly. There's a self hosting option too, but that means maintenance and at 40$/h if it takes 8 hours during the year, it's cheaper to go with the SASS.
ga()
is explicitly called in a few places, but it could be non-existent if the google analytics script is block due to an ad blocker, /etc/hosts, etc.Stub it out to do nothing. Basically: