Skip to content

fix(google-tag-manager): Update to latest src - #5731

Closed
shawnmclean wants to merge 1 commit into
meta:mainfrom
shawnmclean:main
Closed

shawnmclean wants to merge 1 commit into
meta:mainfrom
shawnmclean:main

Conversation

@shawnmclean

Copy link
Copy Markdown

Motivation

I'm using google tag manager assistant to debug a container. I kept getting script load errors, after some digging and comparing the network request against a known working page, I found that docusaurus is using an outdated script.

The new documentation is found at: https://developers.google.com/tag-manager/quickstart

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Debugging from GTM works.

Before change:

image

After change:
image

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Hi @shawnmclean!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@netlify

netlify Bot commented Oct 18, 2021

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

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

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

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 18, 2021
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

1 similar comment
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@shawnmclean shawnmclean changed the title Update google tag manager script. fix(google-tag-manager): Update to latest src Oct 18, 2021
attributes: {
async: true,
src: `https://www.googletagmanager.com/gtag/js?id=${trackingID}`,
src: `https://www.googletagmanager.com/gtm.js?id=${trackingID}`,

@slorber slorber Oct 19, 2021 •

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.

This url does not work for me:

https://www.googletagmanager.com/gtm.js?id=UA-141789564-1

Please show me exactly where you found this, eventually showing a print screen of the doc if there's no possible linking.

(UA-141789564-1 is Docusaurus trackingId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shawnmclean

This plugin is for gtag (global site tag). gtm (google tag manager) is a different, confusingly similar named google thing, and is not what this plugin does.

AFAIK this is still the correct way to use the global site tag, which is still the current recommended way for running just analytics, including the newest GA4. For a gtm plugin, you should make a separate plugin (you could use gtag as a reference) that uses gtm.js instead.

Also remember, this is technically a SPA, so you may need to adjust 3rd party analytics you load via GTM to trigger off "page views", or also as plugin and onRouteUpdate.

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.

Thanks @dsmmcken , agree all this is confusing, we need a plugin for ga, gtm, gtag... 🤪

I'll close this PR for now, and re-open if you can convince me with ref doc that the changes are legit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants