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 to Google Analytics 4 #3598

Merged
merged 3 commits into from
Jun 21, 2023
Merged

Conversation

rajadain
Copy link
Member

@rajadain rajadain commented Jun 16, 2023

Overview

Upgrades to Google Tag Manager, and also to a Google Analytics 4 property.

We're still using Universal Analytics in development and staging, but the production value is updated to a new GA4 property.

All calls to classic Google Analytics custom events are replaced with GTM Data Layer pushes. This will require corresponding configuration in the GTM account to pick up on the mmw events.

Closes #3581

Testing Instructions

Replace Google Analytics with Gtag.js,
update production account to latest.

Closes #3581
These are now reported automatically via changes to
window.location and window.history.

See: https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag
Instead of sending custom events to Google Analytics, Tag Manager
expects us to add them to a dataLayer managed in the browser,
from where it can pull them on demand.

These are tagged with `mmw`, which must also be configured in
Google Tag Manager to work properly.
Copy link
Contributor

@rachelekm rachelekm left a comment

Choose a reason for hiding this comment

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

Success, works great! Confirming I was able to see the GOOGLE_ANALYTICS_ACCOUNT in the first /collect header:
Screenshot 2023-06-21 at 12 20 20 PM

And then had multiple /collect calls with the updated GOOGLE_ANALYTICS_ACCOUNT using the production value:

Screenshot 2023-06-21 at 12 23 42 PM

@rajadain rajadain merged commit 1d14134 into develop Jun 21, 2023
@rajadain rajadain deleted the tt/3581/update-google-analytics branch June 21, 2023 20:04
@rajadain
Copy link
Member Author

Thanks for reviewing!

@rajadain rajadain mentioned this pull request Jun 22, 2023
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.

Replace Google Analytics UA tag with new GA4 tag
2 participants