Open ahwm opened 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Google is sunsetting Universal Analytics on July 1, 2023: [GA4] Make the switch to Google Analytics 4 - Analytics Help
The code above is valid for GA4 so would be future-proof. If this isn't updated in the template then it will be required by the dev to override the template to add their own, which sort of defeats the purpose of the template.
Seems that for now this is the officially supported way if one would like to have Google Analytics version 4 (GA4) for theme slate: https://github.com/shivioua/slate#customizing-google-analytics-code
With a bit inspiration from here: https://github.com/pages-themes/minimal/issues/88#issuecomment-784116273
Yup, it worked for my GH Page, this is the custom header templated that I've added. https://github.com/shivioua/shivioua.github.io/commit/24e954555a844f8f248fe50c4bb8e1160869ef68
Hope it will save a bit of time for more people out there. Have fun :)
I'm not an jekyll expert, but in additon to above comment I've created this PR: https://github.com/pages-themes/slate/pull/82
I assume that similar PRs should be created for all officially supported github pages themes before this one will be merged in.
@shivioua Works great! Thanks!
@shivioua While adding the new client code to _includes/head-custom-google-analytics.html works, Google's process for migrating the account, and setting up the "properties" and "flows" for the new Analytics is entirely incomprehensible to me. Rather than spending an absurd amount of time to learn a wildly overbuilt system (that may or may not act ethically with my users' data) for my extremely modest needs, I've used that same file to integrate with GoatCounter.com, which is simple and works just great for my needs.
Thanks for sharing @brianary. I've put a brief look both on the GH project of Goat Counter and your implementation, looks like worth investigating. My needs are couple levels less sophisticated as what's offered by GA. Will definately give it a try at some point.
@ahwm Looks like this thread can be closed or you'd like to wait for the result of https://github.com/pages-themes/slate/pull/82? @brianary Would you consider creating a PR for supporting GoatCounter in slate theme?
Google has upgraded Google Analytics and is recommending using
gtag.js
instead ofanalytics.js
(and sending emails to anyone usinganalytics.js
on their sites).Instead of
Google is now using this: