Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current Google Analytics support will cease to work next year. #310

Open
yukster opened this issue Nov 13, 2022 · 3 comments · May be fixed by #330
Open

Current Google Analytics support will cease to work next year. #310

yukster opened this issue Nov 13, 2022 · 3 comments · May be fixed by #330

Comments

@yukster
Copy link

yukster commented Nov 13, 2022

GA3, aka Universal Analytics is deprecated and will be shut down on July 1, 2023: https://support.google.com/analytics/answer/11583528

Any plans to update analytics.html to support the GA4 tag?

@jyje
Copy link

jyje commented Jul 7, 2023

Is there any news about it?

@analyticalmonk
Copy link

analyticalmonk commented Aug 27, 2023

No news yet, I guess.
If anyone's managed a workaround, please share!

@yukster
Copy link
Author

yukster commented Aug 27, 2023

I wound up just solving this by overriding the default analytics stuff in the theme. I did so by commenting out the google_analytics config in _config.yml and then making my own head file called includes/my-head.html (which Hydejack includes by default). The contents of that file is (be sure to replace <your GA ID> with your GA4 ID):

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<your GA id>"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '<your GA ID>');
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants