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

Google Analytics 4 support? #1096

Closed
alainassaf opened this issue Feb 15, 2023 · 7 comments
Closed

Google Analytics 4 support? #1096

alainassaf opened this issue Feb 15, 2023 · 7 comments

Comments

@alainassaf
Copy link

Hello,

Is anything special needed to update a beautiful-jekyll site to use Google Analytics 4?

Thanks,
Alain

@leabs
Copy link

leabs commented Feb 17, 2023

From what I've read, you should not need to update anything to get GA working on a site using this theme. Simply uncomment the gtag: "" line in your _config.yml with your gtag and rebuild the site.

If you did want to replace the GA3 tag with the new GA4 tag, it's being rendered in beautiful-jekyll/_includes/google_analytics.html

@sudohainguyen
Copy link

I did as you mentioned but still doesn't work @leabs

@leabs
Copy link

leabs commented Feb 21, 2023

@alainassaf @sudohainguyen I just forked this repo and got GA4 working using the measurement ID as the gtag. This is a GA4 property using web data stream.
Code repo here: https://github.com/leabs/beautiful-jekyll
Live site here: https://beautiful-analytics.vercel.app/

Steps I took:

  1. Forked Repo
  2. Added the MEASUREMENT ID as the un commented gtag in _config.yml
  3. Had to update jekyll for deployment
  4. Pushed to vercel to host.

If you have a public repo I can look at it for you, but this should work.

Screenshot 2023-02-21 at 10 27 05 AM

Screenshot 2023-02-21 at 10 22 59 AM

@sudohainguyen
Copy link

now somehow it works to me 🤣 thanks!

@daattali
Copy link
Owner

Sorry I haven't been responsive, I've been busy with other open source projects. Beautiful Jekyll really does need to move to GA4. If anybody wants to make a PR for it, I'd be happy to get some help.

@daattali
Copy link
Owner

I was reading about google analytics 4 and realized that, as others here have mentioned, it's already supported, using the gtag field.

I will update the config file to make it clear that google_analytics is old and should not be used, and gtag is the one that should be used moving forward.

@daattali
Copy link
Owner

I may also add a warning on pages that have old Universal Analytics without a new Google Analytics 4 configured.

adumont pushed a commit to adumont/adumont.github.io that referenced this issue Oct 20, 2023
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

No branches or pull requests

4 participants