Skip to content

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

Merged
Josh-Cena merged 1 commit into
meta:mainfrom
johnnyreilly:patch-2
Dec 24, 2021
Merged

Josh-Cena merged 1 commit into
meta:mainfrom
johnnyreilly:patch-2

Conversation

@johnnyreilly

Copy link
Copy Markdown
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

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 24, 2021
@Josh-Cena

Copy link
Copy Markdown
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

netlify Bot commented Dec 24, 2021

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚡️ 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

johnnyreilly commented Dec 24, 2021 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

johnnyreilly commented Dec 24, 2021 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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

johnnyreilly commented Dec 24, 2021 •

Copy link
Copy Markdown
Contributor Author

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

Josh-Cena commented Dec 24, 2021 •

Copy link
Copy Markdown
Collaborator

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

johnnyreilly commented Dec 24, 2021 •

Copy link
Copy Markdown
Contributor Author

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!

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Collaborator

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!

@Josh-Cena
Josh-Cena merged commit a17deb6 into meta:main Dec 24, 2021
@johnnyreilly
johnnyreilly deleted the patch-2 branch December 24, 2021 09:28
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
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