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

Add a nonce to the analytics script #4160

Merged
merged 3 commits into from
Feb 6, 2024
Merged

Add a nonce to the analytics script #4160

merged 3 commits into from
Feb 6, 2024

Conversation

Vinnl
Copy link
Collaborator

@Vinnl Vinnl commented Feb 6, 2024

References:

Jira: MNTOR-2904
Figma: N/A

Description

In lieu of upstream adding support for setting a nonce (vercel/next.js#61714), this forks their component and adds the support ourselves. This should make it easy to migrate once the upstream issue is resolved (which presumably will use a similar API).

How to test

Build the app, then run it and verify that data is sent.

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug. - Upstream didn't have tests either :(
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@Vinnl Vinnl added the Review: XS Code review time: up to 30min label Feb 6, 2024
@Vinnl Vinnl requested review from rhelmer and flozia February 6, 2024 15:52
@Vinnl Vinnl self-assigned this Feb 6, 2024
@@ -0,0 +1,99 @@
/* eslint-disable header/header */

// Based on: https://github.com/vercel/next.js/blob/89fcf68c6acd62caf91a8cf0bfd3fdc566e75d9d/packages/third-parties/src/google/ga.tsx
Copy link
Collaborator Author

@Vinnl Vinnl Feb 6, 2024

Choose a reason for hiding this comment

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

The changes we needed are minimal: e7dae82.

(Also wanted to submit upstream, but their Maps and YouTube components are set up a bit differently, my computer crashed trying to build it, and I didn't know how to test it there, so... 🤷 )

@rhelmer rhelmer merged commit 3915ebe into main Feb 6, 2024
12 of 13 checks passed
@rhelmer rhelmer deleted the ga-nonce branch February 6, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: XS Code review time: up to 30min
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants