Skip to content

Commit 88a378c

Browse files
steveruizokclaude
andauthored
fix: add missing GA4 domains to CSP for non-EU regions (tldraw#6534)
Updates Content Security Policy to include additional Google Analytics and Google Tag Manager domains required for GA4 functionality: - Adds www.google-analytics.com and *.googletagmanager.com to connect-src - Adds *.googletagmanager.com, www.google-analytics.com, and *.google-analytics.com to script-src This resolves CSP blocking issues preventing GA4 from working properly in non-EU regions where analytics cookies are enabled. Fixes ENG-3605 🤖 Generated with [Claude Code](https://claude.ai/code) Describe what your pull request does. If you can, add GIFs or images showing the before and after of your change. ### Change type - [x] `bugfix` - [x] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other` Co-authored-by: Claude <noreply@anthropic.com>
1 parent dfdf6b7 commit 88a378c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • apps/dotcom/client/src/utils

apps/dotcom/client/src/utils/csp.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const cspDirectives: { [key: string]: string[] } = {
1313
`https://*.ingest.sentry.io`,
1414
`https://*.ingest.us.sentry.io`,
1515
'https://*.analytics.google.com',
16+
'https://www.google-analytics.com',
17+
'https://*.googletagmanager.com',
18+
'https://www.googletagmanager.com',
1619
// for thumbnail server
1720
'http://localhost:5002',
1821
'https://*.clerk.accounts.dev',
@@ -41,6 +44,9 @@ export const cspDirectives: { [key: string]: string[] } = {
4144
// embeds that have scripts
4245
'https://gist.github.com',
4346
'https://www.googletagmanager.com',
47+
'https://*.googletagmanager.com',
48+
'https://www.google-analytics.com',
49+
'https://*.google-analytics.com',
4450
'https://analytics.tldraw.com',
4551
'https://static.reo.dev',
4652
],

0 commit comments

Comments
 (0)