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

docs: remove mention of 'UA-' in gtag #6184

Merged
merged 1 commit into from
Dec 24, 2021
Merged

docs: remove mention of 'UA-' in gtag #6184

merged 1 commit into from
Dec 24, 2021

Conversation

johnnyreilly
Copy link
Contributor

Motivation

To make the gtag docs less confusing.

To quote the docs here: https://support.google.com/analytics/answer/9744165?hl=en-GB&utm_id=ad#use_existing_tags

Make a note of your GA4 property's name so you can find it later. If your Universal Analytics property name is "Example property (UA-nnnnnnn)", your GA4 property name will be "Example property (xxxxxxx)", without a "UA-" prefix, and where xxxxxxx is a new property number.

The docs as is suggest that gtag's should include "UA-" as universal analytics does. This PR amends that to make it less confusing.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

n/a

Related PRs

@Josh-Cena
Copy link
Collaborator

Never used ganalytics myself, and the doc isn't very clear wrt what's the difference between GA4 and UA... Since we are using this tracking ID to send requests to the GA server, would both of them work? Or is it just that UA-xxxx is used for legacy projects while new projects would have xxxx and we expect new users to always use the latter?

@netlify
Copy link

netlify bot commented Dec 24, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 24e2fa8

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61c57a52c9e67b0007fb5f9c

😎 Browse the preview: https://deploy-preview-6184--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 95
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6184--docusaurus-2.netlify.app/

@johnnyreilly
Copy link
Contributor Author

johnnyreilly commented Dec 24, 2021

Or is it just that UA-xxxx is used for legacy projects while new projects would have xxxx and we expect new users to always use the latter?

It's closer to this - if you're setting up a google tags property you simply won't have a "UA-" prefix - GA 4 properties have a different format. Here's a screenshot of my own tag as an example:

image

See the Property ID on the right? No UA- prefix - this is the norm.

Users may be using Google Analytics or GA4 - giving them information that isn't confusing is the goal 😄

I thought I was doing something wrong until I realised that GA4 does not have a UA- prefix.

@Josh-Cena
Copy link
Collaborator

We also have the thread #2407 where the discussion seems to have shifted to UA vs GA4 in terms of data privacy. Wondering if we should also put up a notice about the nuance between UA- prefix and the absence of one?

@Josh-Cena Josh-Cena added the pr: documentation This PR works on the website or other text documents in the repo. label Dec 24, 2021
@johnnyreilly
Copy link
Contributor Author

johnnyreilly commented Dec 24, 2021

Maybe - I'm not too sure of the GDPR implications to be honest. My sense is that Google want to deprecate UA and have people migrate to GA4 (I was prompted in Google Analytics which is what lead me to investigating using GA4).

The motivation of this PR is just docs really though; if someone is setting up a google tag they will not have a "UA-" prefixed property, so the aim is to make the docs reflect that. To show you what UA vs GA4 looks like side by side consider the following:

image

The one above (blog.johnnyreilly.com) is UA and has a UA prefix
The one below (blog.johnnyreilly.com - GA4) is GA4 and does not have a UA prefix

See this code for an example of side by side usage: https://github.com/johnnyreilly/blog.johnnyreilly.com/blob/3b7fc346897a15f0752f294bd7515789428938c2/blog-website/docusaurus.config.js#L29-L34

@Josh-Cena
Copy link
Collaborator

I'm in favor of changing our doc's defaults, just asking about whether the old config still makes sense for UA users. My idea is to add an admonition briefly explaining that legacy UA IDs have the UA- prefix while GA4 ones don't, and maybe link to the official doc

@johnnyreilly
Copy link
Contributor Author

whether the old config still makes sense for UA users.

Oh totally - the existing UA docs are fine. My sense is, that whilst Google are keen for people to upgrade to GA 4, UA will still be around for a decent time to come.

@johnnyreilly
Copy link
Contributor Author

johnnyreilly commented Dec 24, 2021

My idea is to add an admonition briefly explaining that legacy UA IDs have the UA- prefix while GA4 ones don't, and maybe link to the official doc

Feel free to tweak my PR. I'm going to be offline for a while; will be checking my phone a bit

@Josh-Cena Josh-Cena changed the title docs: improve gtag documentation (remove mention of 'UA-') docs: remove mention of 'UA-' in gtag Dec 24, 2021
@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Dec 24, 2021

The gtag stuff is always a bit messy for me🤦‍♂️ A while back I learned that GTAG and GTM may be different (#5731). And now I'm trying to differentiate between GA3/UA, GA4, GTAG, GTM—X is a superset of Y, W is a successor of Z...

I guess we don't need more information since the tracking ID is given by GTAG anyways and existing users probably know what they are doing. My only question is whether we should synchronize the docs in the GA plugin, and whether that plugin still works in GA4 (if not, we need to put up a notice / update the plugin)

@johnnyreilly
Copy link
Contributor Author

johnnyreilly commented Dec 24, 2021

My only question is whether we should synchronize the docs in the GA plugin, and whether that plugin still works in GA4 (if not, we need to put up a notice / update the plugin)

The GA plugin docs are fine and don't need changing. From a Docusaurus perspective, GA and GA4 are different products. GA plugin does not support GA4 and vice versa.

It's likely that one day GA will disappear and GA4 will live on - but I would expect that to be a very long time in the future.

The gtag stuff is always a bit messy for me🤦‍♂️

Haha - yeah I'm not an expert to be sure!

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

If the GA4 ID works for GTAG plugin—let's do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants