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

GA4 analytics #1715

Merged
merged 5 commits into from
Jun 13, 2023
Merged

GA4 analytics #1715

merged 5 commits into from
Jun 13, 2023

Conversation

ajparsons
Copy link
Contributor

@ajparsons ajparsons commented May 4, 2023

Uses the cookieless GA4 approach described in https://docs.google.com/document/d/1ZXbkXoLE0eLnUWJaVv_8xpnVOlOHGCxPP_Uo7cfoFJo/edit

  • Adds GA4 config
  • monkey-patches document.cookies to prevent ga setting cookies.

This PR originally used the measurement protocol - but those commits will come out in a final squish.

- in practice, this approach is unused
- Added GA4 config alongside universal analytics
- Replace custom event tracking with measurement protocol approach
- Adjust some link event names to conform with ga4 requirements
 (lower case, underscores).
@ajparsons ajparsons requested a review from zarino May 4, 2023 15:00
- monkeypatches document.cookies to stop it setting cookies
- sets random client_id on each page load
- replaces measurement protocol approach
- returns random client_id rather than storing anything.
@zarino zarino requested a review from struan June 12, 2023 10:47
Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

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

looks fine, doesn't seem to set a cookie. Seems to send things to Google :)

@ajparsons ajparsons merged commit 3d47f43 into master Jun 13, 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.

2 participants