theNewDynamic / gohugo-theme-ananke

Ananke: A theme for Hugo Sites
https://gohugo-ananke-theme-demo.netlify.app/
MIT License
1.14k stars 1.16k forks source link

Investigate switching from `_internal/google_analytics_async.html` to `_internal/google_analytics.html` #546

Closed regisphilibert closed 2 years ago

regisphilibert commented 2 years ago

According to Hugo Doc, we should probably use _internal/google_analytics which supports G4.

I have yet to understand the consequences of such a switch.

budparr commented 2 years ago

very bad idea to not use async

Aweponken commented 2 years ago

very bad idea to not use async

Could you elaborate a bit more on this comment @budparr?

budparr commented 2 years ago

Perhaps I'm missing something about the loading of G4, but unless it's loaded async automatically, I would never load a blocking script (except for certain, typically rare instances).

regisphilibert commented 2 years ago

After investigation I think the async template is obsolete, it seems the default is now async as well, that'S why it has been updated to support GA4 and not the async one which might be kept alive to avoid breaking changes

https://github.com/gohugoio/hugo/blob/133e4bfbeee47bf6843fbcad90f14501f3d3a099/tpl/tplimpl/embedded/templates/google_analytics.html