Fix apex→www canonicalization (sitemap 3XX) - #1
Conversation
All three sitemap <loc> URLs and the robots.txt Sitemap line used the apex host, which 308-redirects to www — Ahrefs flagged this as "3XX redirect in sitemap (3 URLs)". Also canonicalized rel=canonical, og:url, og:image and twitter:image across index/ngos/investors, which had the same apex→redirect mismatch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughGoogle Analytics tracking is initialized across all pages with ID G-385NGNGD7J. Page metadata—canonical links and Open Graph/Twitter references—are normalized to ChangesDomain Normalization and Analytics Setup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 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)
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 |
investors.html: drop unverifiable "designed to be compatible with their emerging dMRV programs" and rename heading to "Standards-aligned"; keep the defensible "same MRV logic as Verra/Gold Standard" statement. .vercelignore: add *.bak so backup files are never published to production (they are gitignored but were not vercelignored). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@investors.html`:
- Around line 7-15: The gtag('config', 'G-385NGNGD7J') call initializes
analytics tracking immediately without checking for user consent, which violates
privacy regulations in consent-required regions. Before the gtag('config') call,
add a gtag('consent', 'default', {...}) command to set the default consent state
to denied for analytics and ad_storage properties, ensuring no data is collected
until the user explicitly provides consent. This defers analytics collection
until after the user has made their consent decision, bringing the
implementation into compliance with consent-required regulations.
In `@ngos.html`:
- Around line 7-15: The GA configuration is being sent immediately on page load
without applying consent mode first, which violates consent-first principles.
Before the gtag('config', 'G-385NGNGD7J') call on line 14, add a gtag('consent',
'default', {...}) statement that sets analytics_storage to 'denied' to establish
a default denied consent state. Then, after obtaining actual user consent (from
a consent banner or preference center), update the consent state by calling
gtag('consent', 'update', {...}) with analytics_storage set to 'granted' to
enable GA tracking only when the user has explicitly consented.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4c935e41-990f-46af-9ef4-91ca6524cb82
📒 Files selected for processing (3)
index.htmlinvestors.htmlngos.html
🚧 Files skipped from review as they are similar to previous changes (1)
- index.html
| <!-- Google tag (gtag.js) --> | ||
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script> | ||
| <script> | ||
| window.dataLayer = window.dataLayer || []; | ||
| function gtag(){dataLayer.push(arguments);} | ||
| gtag('js', new Date()); | ||
|
|
||
| gtag('config', 'G-385NGNGD7J'); | ||
| </script> |
There was a problem hiding this comment.
Gate GA initialization behind consent mode before gtag('config').
Line 14 initializes tracking immediately. Add a default denied consent state first (and update it after user consent) to avoid pre-consent analytics collection in consent-required regions.
Suggested patch
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
+ gtag('consent', 'default', {
+ ad_storage: 'denied',
+ analytics_storage: 'denied',
+ ad_user_data: 'denied',
+ ad_personalization: 'denied'
+ });
gtag('config', 'G-385NGNGD7J');
</script>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <!-- Google tag (gtag.js) --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('config', 'G-385NGNGD7J'); | |
| </script> | |
| <!-- Google tag (gtag.js) --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('consent', 'default', { | |
| ad_storage: 'denied', | |
| analytics_storage: 'denied', | |
| ad_user_data: 'denied', | |
| ad_personalization: 'denied' | |
| }); | |
| gtag('config', 'G-385NGNGD7J'); | |
| </script> |
🤖 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 `@investors.html` around lines 7 - 15, The gtag('config', 'G-385NGNGD7J') call
initializes analytics tracking immediately without checking for user consent,
which violates privacy regulations in consent-required regions. Before the
gtag('config') call, add a gtag('consent', 'default', {...}) command to set the
default consent state to denied for analytics and ad_storage properties,
ensuring no data is collected until the user explicitly provides consent. This
defers analytics collection until after the user has made their consent
decision, bringing the implementation into compliance with consent-required
regulations.
| <!-- Google tag (gtag.js) --> | ||
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script> | ||
| <script> | ||
| window.dataLayer = window.dataLayer || []; | ||
| function gtag(){dataLayer.push(arguments);} | ||
| gtag('js', new Date()); | ||
|
|
||
| gtag('config', 'G-385NGNGD7J'); | ||
| </script> |
There was a problem hiding this comment.
Apply consent mode before GA config here as well.
Line 14 sends GA config on load. Mirror a default denied consent state before gtag('config', ...), then switch to granted only after consent.
🤖 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 `@ngos.html` around lines 7 - 15, The GA configuration is being sent
immediately on page load without applying consent mode first, which violates
consent-first principles. Before the gtag('config', 'G-385NGNGD7J') call on line
14, add a gtag('consent', 'default', {...}) statement that sets
analytics_storage to 'denied' to establish a default denied consent state. Then,
after obtaining actual user consent (from a consent banner or preference
center), update the consent state by calling gtag('consent', 'update', {...})
with analytics_storage set to 'granted' to enable GA tracking only when the user
has explicitly consented.
Why
Ahrefs' 2026-06-04 crawl flagged a new error: 3XX redirect in sitemap — 3 URLs. Confirmed live: the apex host
regenbazaar.com308-redirects towww.regenbazaar.com, but the sitemap,robots.txt, and all page meta tags pointed at the apex. A sitemap (andrel=canonical) pointing at a redirecting URL hurts crawl efficiency and canonical signals.What changed
sitemap.xml: 3<loc>→www.hostrobots.txt:Sitemap:line →www.hostindex/ngos/investors.html:rel=canonical,og:url,og:image,twitter:image→www.host (same apex→redirect mismatch — sibling fix)Verified
All canonical
wwwURLs (and the og-image asset) now return 200, no 308:No apex (non-www) references remain in any served file.
After merge
Re-submit
sitemap.xmlin Google Search Console and re-crawl in Ahrefs to clear the error.🤖 Generated with Claude Code
Summary by CodeRabbit
wwwsubdomain across site pages.wwwhost.*.bakfiles.