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

Add support for Google Analitics global site tag #1495

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

thomasturrell
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Adds support for Google Analytics 4 properties.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

There are no tests in this pull request, can someone advise me what testing would be appropriate?

@SanderElias
Copy link
Contributor

I'm not worried about the tests of this. But I'm worried about the backward compatibility. Is this providing the same function with an updated method, or is it providing a slightly different option?
The script looks good to me, but I don't have time to dig into the details of the GAPI on this.
Can you point me to some relevant resources?

@thomasturrell
Copy link
Contributor Author

Please keep in mind I am no expert on Google Analytics so please check my findings and conclusions!

Google Analytics have two types of ID, the newer Google Analytics 4 properties have ID's that are prefixed "G-" and the older Universal Analytics properties have ID's that are prefixed "UA-".

Google documents the process of seeing up a Google Analytics 4 property here:
https://support.google.com/analytics/answer/9304153#zippy=%2Cweb%2Cadd-the-global-site-tag-directly-to-your-web-pages%2Cfind-your-g--id-for-any-platform-that-accepts-a-g--id

Google have a migration guide:
https://developers.google.com/analytics/devguides/migration/ua/analyticsjs-to-gtagjs

This pull request should be backwards compatible with pervious versions of Google Analytics. It adds support for D's that are prefixed "G-" sites with ID's that are prefixed "UA-" should be unaffected.

@GuzmanPI please could you have a look at this pull request, I noticed that you are the original author of this plugin.

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.

2 participants