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

Support the new Google analytics gtag.js #7691

Merged
merged 4 commits into from
Dec 7, 2020

Conversation

davidfischer
Copy link
Contributor

  • This applies to docs and to the dashboard
  • This is backwards compatible with the old UA-XXX properties assuming nothing custom is going on
  • Supports the new G-XXXX properties
  • Continues to support disabling analytics and do not track
  • Sends custom dimensions like before
  • Shorter cookie expiry like before

Fixes #7662

Testing

The easiest way to test this is to set settings.GLOBAL_ANALYTICS_CODE and rebuild some documentation and/or view the dashboard and verify that GA is loaded and data is sent (the collect call in the screenshot). There should be another call when clicking the flyout menu.

Note that I didn't build the static files as part of this PR so you'll need to run npm run build to do that. I will do that right before merging this to avoid conflicts.

Screen Shot 2020-11-23 at 11 55 17 AM

- This applies to docs and to the dashboard
- This is backwards compatible with the old UA-XXX properties
  assuming nothing custom is going on
- Supports the new G-XXXX properties
- Continues to support disabling analytics and do not track
- Sends custom dimensions like before
- Shorter cookie expiry like before
@ericholscher
Copy link
Member

Not an issue here, but I did see "global_analytics_code": "None" in my testing prior to setting the variable. Not gonna be an issue for us in prod, but probably worth fixing at some point.

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This looks 💯 in my testing. I tested the dashboard and the in-doc pageviews and events. I think we're good to ship it.

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

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

I was able to see this as well. Had to use chromium bc my firefox was blocking everything :D. I have rebuilt the static assets

@stsewd stsewd merged commit 102ff2f into master Dec 7, 2020
@stsewd stsewd deleted the davidfischer/support-new-google-analytics branch December 7, 2020 23:53
@JuanDCG
Copy link

JuanDCG commented Dec 9, 2020

With "global_analytics_code": "G-XXXXXX" it is now working for me.

Thank you!

@sachin-suresh-rapyuta
Copy link

With "global_analytics_code": "G-XXXXXX" it is now working for me.

Thank you!

@JuanDCG - I am at the step where I just added my ReadtheDocs website URL to Google Analytics Web stream, where I have my G-ID now. I pasted this ID in ReadtheDocs admin's Analytics code field.

  1. Can you please let me know the next steps?
  2. Is installing Google tag mandatory?

@JuanDCG
Copy link

JuanDCG commented Mar 4, 2023

With "global_analytics_code": "G-XXXXXX" it is now working for me.
Thank you!

@JuanDCG - I am at the step where I just added my ReadtheDocs website URL to Google Analytics Web stream, where I have my G-ID now. I pasted this ID in ReadtheDocs admin's Analytics code field.

1. Can you please let me know the next steps?

2. Is installing Google tag mandatory?

Sorry, It was 2 years ago and nowadays I can't help you.

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.

Not working with Google Analytics 4
5 participants