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

Added support for Google Analytics 4 Properties. Removed duplication of Javascript snippets. #429

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mikebowler
Copy link

This is an enhancement or feature.

Summary

The old Google Analytics uses codes of the form UA-XXXXX. The new Google Analytics uses codes of the form G-XXXXX and they have different javascript snippets that need to be used for each. This PR adds support for the G- style codes.

Also previously the javascript for the UA codes was in two places and it's now in one.

Context

@mikebowler mikebowler marked this pull request as draft August 13, 2021 16:49
@mikebowler mikebowler marked this pull request as ready for review August 13, 2021 16:53
@aronisstav
Copy link

Based on the sample code I am currently seeing on my Analytics account, there seems to no longer be any need for different javascript depending on the analytics version used, so this can be further simplified (I am looking at a gtag-based snippet using a "UA-" tag).

@mikebowler
Copy link
Author

UA tags will cease to work on July 1, 2023. Until then, both tags need to be supported.

Copy link

@leewc leewc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the maintainer of this repo, but I wanted to thank you for this, I've manually applied the same fix to my own blog following Google Universal Analytics sunset. Hope it gets merged to mainline some day!

leewc added a commit to leewc/leewc.github.io that referenced this pull request Apr 11, 2023
Main repo that this is forked from does not appear to be
maintained. Referenced mmistakes/so-simple-theme#429
leewc added a commit to leewc/leewc.github.io that referenced this pull request Apr 11, 2023
Main repo that this is forked from does not appear to be
maintained. Referenced mmistakes/so-simple-theme#429
leewc added a commit to leewc/leewc.github.io that referenced this pull request Apr 11, 2023
Main repo that this is forked from does not appear to be
maintained. Referenced mmistakes/so-simple-theme#429
@adilansari
Copy link

@mmistakes can we get this merged please?

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 this pull request may close these issues.

None yet

4 participants