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

Update Google Analytics #242

Open
gene1wood opened this issue Jul 2, 2024 · 1 comment
Open

Update Google Analytics #242

gene1wood opened this issue Jul 2, 2024 · 1 comment

Comments

@gene1wood
Copy link
Collaborator

Update Google Analytics code to use this new or additional code

https://bugzilla.mozilla.org/show_bug.cgi?id=1243082#c1

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-49796218-39', 'auto');
  ga('send', 'pageview');

</script>
@janbrasna
Copy link
Collaborator

janbrasna commented Jul 8, 2024

While GA3/UA is closed now, it is true that some of the UA properties were (auto)migrated to GA4, and even the old analytics.js tracking script can be used to submit data via legacy APIs surprisingly even under the original UA-* property ID.

  • UA-* (GA3) is valid only if the property was (auto)migrated. For GA4 you'd need a G-* identifier otherwise. Ask the OP if the UA ID is still valid, or they had made new G-* props.
  • The config was for mozilla.github.io that's no longer in use.
  • Without a tracking consent, you'd need to run GA in "anonymous" mode.

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

No branches or pull requests

2 participants