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

Prepare code to remove GA from Web and AMP #1393

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

deedeeh
Copy link
Contributor

@deedeeh deedeeh commented May 22, 2024

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.

Copy link

changeset-bot bot commented May 22, 2024

🦋 Changeset detected

Latest commit: 93a57e5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/commercial Minor

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

@arelra arelra force-pushed the dina/prepare-code-to-remove-ga branch from b0feadc to c300403 Compare May 23, 2024 12:24
@deedeeh deedeeh added the [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR label Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

🚀 0.0.0-beta-20240603085241 published to npm as a beta release

@deedeeh deedeeh marked this pull request as ready for review June 3, 2024 09:20
@deedeeh deedeeh requested a review from a team as a code owner June 3, 2024 09:20
}
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';
Copy link
Contributor

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

Copy link
Contributor

@SiAdcock SiAdcock left a comment

Choose a reason for hiding this comment

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

Great job @deedeeh and @arelra!

Co-authored-by: Simon Adcock <simonadcock2@gmail.com>
Copy link
Contributor

github-actions bot commented Jun 6, 2024

Ad load time test results

For consented, top-above-nav took on average 4355.7ms to load.
For consentless, top-above-nav took on average 2977.3ms to load.

Test conditions:

  • 5mbps download speed
  • 1.5mbps upload speed
  • 150ms latency

Copy link
Member

@arelra arelra left a comment

Choose a reason for hiding this comment

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

Nice work @deedeeh !

@deedeeh deedeeh merged commit a90f1d4 into main Jun 7, 2024
11 checks passed
@deedeeh deedeeh deleted the dina/prepare-code-to-remove-ga branch June 7, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants