Skip to content

Commit 093e6e6

Browse files
ChengaDevclaude
andcommitted
Add canonical override to SEO component, point all privacy policy variants to /privacy-policy
Fixes GSC "Duplicate, Google chose different canonical" for /it/, /fr/, /es/ privacy policy pages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent db545f3 commit 093e6e6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/PrivacyPolicy.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const PrivacyPolicy = () => {
99
<SEO
1010
title="Privacy Policy | ShotClock Pro"
1111
description="Privacy policy for ShotClock Pro — free online basketball shot clock. Learn how we use cookies and third-party services like Google Analytics and Google AdSense."
12+
canonical="https://www.24shotclock.com/privacy-policy"
1213
/>
1314
<Title>Privacy Policy</Title>
1415
<LastUpdated>Last updated: April 7, 2026</LastUpdated>

src/components/SEO.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ interface SEOProps {
1010
title: string;
1111
description: string;
1212
schema?: object;
13+
canonical?: string;
1314
}
1415

15-
const SEO: React.FC<SEOProps> = ({ title, description, schema }) => {
16+
const SEO: React.FC<SEOProps> = ({ title, description, schema, canonical: canonicalOverride }) => {
1617
const { languageCode } = useLocalization();
1718
const location = useLocation();
1819

@@ -22,7 +23,7 @@ const SEO: React.FC<SEOProps> = ({ title, description, schema }) => {
2223
? location.pathname
2324
: (location.pathname.slice(`/${languageCode}`.length) || '/');
2425

25-
const canonical = `${BASE_URL}${location.pathname}`;
26+
const canonical = canonicalOverride ?? `${BASE_URL}${location.pathname}`;
2627

2728
const getLangUrl = (lang: string) => {
2829
if (lang === 'en') return `${BASE_URL}${pagePath}`;

0 commit comments

Comments
 (0)