When a store sells in several countries or languages, the same product often has several URLs: one for the U.S., one for Canada, one for the U.K., perhaps one in French. Hreflang annotations link those versions together and label each one. A tag such as <link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/products/rain-jacket" /> tells Google that this URL serves English speakers in Great Britain.
Google accepts hreflang in three equivalent ways: link tags in the page head, HTTP headers, or the XML sitemap. The value uses an ISO 639-1 language code, optionally followed by an ISO 3166-1 Alpha 2 region code. A region code by itself is not supported. Each version must list itself and every other version, and the links must point both ways, or Google ignores them. An x-default value marks the fallback page for shoppers whose language or region matches none of your versions.
Why it matters for eCommerce
Without hreflang, a Canadian shopper may land on the U.S. page with U.S. prices and shipping, and similar English versions can compete with each other in results. Correct hreflang sends each shopper to the page with the right currency, shipping and policies, which protects conversion rate.
How it works in practice
Map every market to one URL pattern, such as subfolders or country domains. On Shopify, Markets automatically adds hreflang tags for international domains and subfolders unless you turn them off. On other platforms, generate tags from the same source as your sitemap. Each version should canonicalize to itself, not to the U.S. page. Note that Google does not use hreflang to detect a page’s language, so the content must actually be localized.
Common mistakes
- Using “uk” for the United Kingdom (the code is “gb”; “uk” means Ukrainian) or “ca” for Canada (“ca” means Catalan).
- Missing return links between versions.
- Pointing hreflang at redirected, noindexed or canonicalized URLs.