Skip to content

fix(proxy): allow region1.google-analytics.com#753

Merged
harlan-zw merged 1 commit intonuxt:mainfrom
captnCC:main
May 7, 2026
Merged

fix(proxy): allow region1.google-analytics.com#753
harlan-zw merged 1 commit intonuxt:mainfrom
captnCC:main

Conversation

@captnCC
Copy link
Copy Markdown

@captnCC captnCC commented May 7, 2026

🔗 Linked issue

resolves #752

📚 Description

This PR adds the region1.google-analytics.com domain used by GA in some regions to the allow

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

@captnCC is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@753

commit: b9c4149

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds region1.google-analytics.com to the proxy domain allowlist in the googleAnalytics registry entry in packages/script/src/registry.ts. The change expands the set of first-party Google Analytics endpoints that can be proxied, while preserving existing allowed domains including www.google.com, www.google.*, and www.googletagmanager.com. This resolves domain rejection errors for analytics collections using the region-specific endpoint.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding region1.google-analytics.com to the proxy allowlist, which directly addresses the fix.
Description check ✅ Passed The description is related to the changeset, mentioning the addition of region1.google-analytics.com domain to the proxy allowlist and referencing the linked issue #752.
Linked Issues check ✅ Passed The PR directly resolves the requirement from issue #752 by adding region1.google-analytics.com to the proxy allowlist, which was the expected behavior requested.
Out of Scope Changes check ✅ Passed All changes are within scope: only the proxy domain allowlist for googleAnalytics was modified to include the requested domain, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/script/src/registry.ts (1)

767-767: ⚡ Quick win

Prefer *.google-analytics.com wildcard over the single region1 entry 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 of region1 suggests 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 clarity entry (lines 599–608), where www.clarity.ms is kept literal for build-time bundle URL rewrites while *.clarity.ms is 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.com stays as a literal entry (needed for the build-time bundle URL rewrite, which skips wildcards), and *.google-analytics.com covers region1, region2, region3, and any future subdomains at runtime — matching the established *.clarity.ms pattern.

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6ddc9f6 and b9c4149.

📒 Files selected for processing (1)
  • packages/script/src/registry.ts

@harlan-zw
Copy link
Copy Markdown
Collaborator

Good catch, thanks!

@harlan-zw harlan-zw merged commit 58f81ad into nuxt:main May 7, 2026
10 of 11 checks passed
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.

googleAnalytics proxy: region1.google-analytics.com rejected with 403 "Domain not allowed"

2 participants