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

feat: Support GA4 - Google Analytics 4 properties #555

Closed
9468305 opened this issue Nov 11, 2020 · 2 comments
Closed

feat: Support GA4 - Google Analytics 4 properties #555

9468305 opened this issue Nov 11, 2020 · 2 comments

Comments

@9468305
Copy link

9468305 commented Nov 11, 2020

Summary

Google Analytics has just released a new version, named GA4(Google Analytics 4 properties).
Those javascript has been changed.
So would you upgrade to support this new version?

Meet the next generation of Google Analytics

Motivation

The current jeklly configuration works great. But when I upgrade my GA to GA4 on GA website, the tracing data would missing obviously.

Guide-level explanation

The current config tag is google_analytics: UA-TRACE-ID.
Maybe add another tag, such as google_analytics_4: G-TRACE-ID.

Reference-level explanation

it's easy to upgrade, by Google's guide.

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

  gtag('config', 'G-WY4HPW1HYT');
</script>

Drawbacks

none.

Unresolved Questions

none.

@DirtyF DirtyF transferred this issue from jekyll/jekyll Nov 11, 2020
@Victornovikov
Copy link

Can someone help me understand how to fix this by adjusting _includes files?
I tried the following approach

  1. go into gem folder and edit analytics.html file
  2. update code there with new script
  3. rebuild with bundle exec Jekyll build

sadly I don't see any changes.

I am new to Jekyll / Ruby and appreciate any guidance.

@9468305
Copy link
Author

9468305 commented Dec 24, 2020

#561 is the right answer.

@9468305 9468305 closed this as completed Dec 24, 2020
@jekyll jekyll locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants