fix(proxy): allow region1.google-analytics.com#753
Conversation
|
@captnCC is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
📝 WalkthroughWalkthroughThis PR adds Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/script/src/registry.ts (1)
767-767: ⚡ Quick winPrefer
*.google-analytics.comwildcard over the singleregion1entry to avoid the same 403 for future regional endpoints.GA4 routes collection hits to regional endpoints (
region1,region2,region3.google-analytics.com) depending on user location, and the addition ofregion1suggests Google may add more in the future, so without flexibility in the policy, lost data is likely to be missed.The codebase already has this exact precedent in the
clarityentry (lines 599–608), wherewww.clarity.msis kept literal for build-time bundle URL rewrites while*.clarity.msis added as a wildcard for runtime coverage. The same pattern applies here.🛡️ Proposed fix – use wildcard instead of single regional entry
- domains: ['www.google-analytics.com', 'region1.google-analytics.com', 'analytics.google.com', 'stats.g.doubleclick.net', 'pagead2.googlesyndication.com', 'www.googleadservices.com', 'googleads.g.doubleclick.net', 'www.google.com', 'www.google.*', 'www.googletagmanager.com'], + domains: ['www.google-analytics.com', '*.google-analytics.com', 'analytics.google.com', 'stats.g.doubleclick.net', 'pagead2.googlesyndication.com', 'www.googleadservices.com', 'googleads.g.doubleclick.net', 'www.google.com', 'www.google.*', 'www.googletagmanager.com'],
www.google-analytics.comstays as a literal entry (needed for the build-time bundle URL rewrite, which skips wildcards), and*.google-analytics.comcoversregion1,region2,region3, and any future subdomains at runtime — matching the established*.clarity.mspattern.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/script/src/registry.ts` at line 767, The domains array entry for Google Analytics in registry.ts uses a hardcoded 'region1.google-analytics.com' which will miss other regional endpoints; update the domains list (the domains: [...] array where google-analytics entries are defined) to replace the specific 'region1.google-analytics.com' with a wildcard '*.google-analytics.com' while keeping 'www.google-analytics.com' literal so build-time bundle URL rewrites still work (follow the same pattern used for the clarity entry).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/script/src/registry.ts`:
- Line 767: The domains array entry for Google Analytics in registry.ts uses a
hardcoded 'region1.google-analytics.com' which will miss other regional
endpoints; update the domains list (the domains: [...] array where
google-analytics entries are defined) to replace the specific
'region1.google-analytics.com' with a wildcard '*.google-analytics.com' while
keeping 'www.google-analytics.com' literal so build-time bundle URL rewrites
still work (follow the same pattern used for the clarity entry).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f31f5dac-ab74-47c9-b847-0f8a68eea665
📒 Files selected for processing (1)
packages/script/src/registry.ts
|
Good catch, thanks! |
🔗 Linked issue
resolves #752
📚 Description
This PR adds the
region1.google-analytics.comdomain used by GA in some regions to the allow