-
Notifications
You must be signed in to change notification settings - Fork 3
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
Prepare code to remove GA from Web and AMP #1393
Conversation
🦋 Changeset detectedLatest commit: 93a57e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b0feadc
to
c300403
Compare
🚀 0.0.0-beta-20240603085241 published to npm as a beta release |
} | ||
const navigationEvents = performance.getEntriesByType('navigation'); | ||
const lastNavigationEvent = navigationEvents[navigationEvents.length - 1]; | ||
return lastNavigationEvent?.type; | ||
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType#navigation | ||
return lastNavigationEvent?.entryType === 'navigation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit refactor, see comment in related DCR PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Simon Adcock <simonadcock2@gmail.com>
Ad load time test resultsFor Test conditions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @deedeeh !
What does this change?
This PR removes Google Analytics from theguardian.com domain but not any other subdomains. Here is a list of the subdomains:
After this PR changes we shouldn't see:
window.gaData
window.googleAnalyticsObject
window.guardian.GAData
(articles)window.guardian.config.googleAnalytics
We still have
window.gaGlobal
which is loaded by Google ads and we have no control to remove it.This was tested locally and no requests are made to google-analytics
Here are the other PRs related to this work guardian/dotcom-rendering#11470 and guardian/frontend#27188
Why?
The Guardian has been working carefully over the course of many years to build similar reporting capabilities as Google Analytics, using the Data Lakehouse. There are many tactical and strategic benefits in migrating use-cases to Ophan and subsequently removing GA, some large examples are consent (GA sits behind consent) and costs.