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 code to use new GA4 trackers #118

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

abought
Copy link
Collaborator

@abought abought commented Sep 18, 2023

Purpose

Fix #108 . This is a very simplistic migration for coarse-grained pageview tracking of visits to TIS. It does not use any advanced features, such as feature-level event based analytics.
https://developers.google.com/analytics/devguides/migration/ua/analyticsjs-to-gtagjs

Preliminary evaluation suggests that neither TIS nor MIS are presently using the GA integration feature (no tracker defined via admin panel). Thus we expect minimal impact on existing deployments. The prior google analytics version stopped collecting data in July 2023, hence no old sites will lose the ability to collect analytics if this code is changed.

Deployment Notes

Due to user privacy concerns, we should take care to minimize sensitive data collection where possible.

We have created a GA4 property with many default features explicitly turned off. We have deauthorized third party sharing, google support access, "user-provided data capabilities", scrolling, form, and file download tracking, and ad integrations. To deploy this consistently, the UM terraform repos will need to be modified to include the GA tracking code whenever the config file is regenerated (for a new server).

Testing notes

It typically takes 12-72 hr for analytics events to become visible in the GA dashboard. Browser extensions such as ublock origin may interfere with testing this feature.

Per UM team policy, UM PIs have been given admin-level access to the TIS GA project as contacts of record.

No events are sent for navigation to sub-pages. Preliminary evaluation suggests that CG uses hash-based routes, rather than the JS history manipulation API; this style of URL manipulation is not automatically captured by the analytics tool.

The old scripts stopped accepting user data as of July 2023.
@abought abought changed the title [hold] Update Google analytics code to use new GA4 trackers Update Google analytics code to use new GA4 trackers Sep 18, 2023
@seppinho seppinho merged commit c3c26fa into genepi:master Sep 28, 2023
1 check passed
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.

[deprecation] Google Analytics: old style no longer collects data
2 participants