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

fix(csp): allow GA via Tag Manager #10715

Merged
merged 1 commit into from
Mar 15, 2024
Merged

fix(csp): allow GA via Tag Manager #10715

merged 1 commit into from
Mar 15, 2024

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Mar 15, 2024

Summary

(Extracted from #10687.)

Problem

We're migrating to GA4 and have connected our UA Property, which causes the analytics.js to load gtag.js, but that origin (as well as the origins used by gtag.js for measuring) are not in our CSP, so we're seeing very low numbers in GA4.

Solution

Add the GA4-related origins to script-src, connect-src and img-src respectively.

Ref: https://developers.google.com/tag-platform/security/guides/csp#google_analytics_4_google_analytics


How did you test this change?

#10687 is deployed on stage, and we don't get any CSP errors there.

@caugner caugner requested a review from argl March 15, 2024 17:00
@caugner caugner requested a review from a team as a code owner March 15, 2024 17:00
@caugner caugner changed the title fix(csp): allow GA via Google Tag Manager fix(csp): allow GA via Tag Manager Mar 15, 2024
@caugner caugner merged commit e8ec3d3 into main Mar 15, 2024
12 checks passed
@caugner caugner deleted the update-csp-for-gtag branch March 15, 2024 18:02
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