jekyll-theme-yat icon indicating copy to clipboard operation
jekyll-theme-yat copied to clipboard

Google Analytics 4 Tag - Data not received

Open jacoporepossi opened this issue 3 years ago • 2 comments

Hi there,

I'm having some issue switching from GA to GA4, as the tag changes from UA-xxxxx to G-xxxxx. I simply tried to change my _config.yml but with no success.

Any idea on how to fix the tracking? Perhaps the google-analytics.html should be updated following what has been done in the minima example? It looks like they switched from https://www.google-analytics.com/analytics.js to https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}

Thank you!

jacoporepossi avatar Jun 10 '22 08:06 jacoporepossi

As a test, I tried to update my google-analytics.html following the minima example I linked before and now it works.

However I don't know if my solution is reliable or not since I was not the author in the first place 😄

jacoporepossi avatar Jun 10 '22 09:06 jacoporepossi

One way to achieve that without overriding the HTML file locally, is to actually switch to the latest version of the minima bundle, using remote_theme: jekyll/minima instead of theme: minima in your _config.yml

I used that while also trying to update to GA4 and Dark mode: https://stackoverflow.com/a/70721593/1163698

SRombauts avatar Nov 06 '22 10:11 SRombauts

Hi @jacoporepossi,

I just update to support GA4, please see #112. Thanks for supporting YAT theme.

Thanks & Regards

jeffreytse avatar Jun 24 '23 03:06 jeffreytse