The same page often answers at more than one address: with and without www, over http and https, with a trailing slash or without, with tracking tags such as ?utm_source=newsletter, or as a print or sort variant. To a search engine these are separate URLs with the same content. A canonical URL tells it which one is the real page.
Why it matters for search
Without a clear canonical, a search engine picks one itself. It may choose a version you did not want to show, split signals between duplicates, or spend crawling time on copies. Google's guide to consolidating duplicate URLs (opens in a new tab) lists several ways to state your preference, from strongest to weakest:
| Method | Strength (per Google) | Use |
|---|---|---|
| 301 redirect to the preferred URL | Strong | Retiring a duplicate entirely |
rel="canonical" link element |
Strong | HTML pages that must stay reachable |
rel="canonical" HTTP header |
Strong | Non-HTML files such as PDFs |
| Listing the URL in a sitemap | Weak | Supporting the other signals |
Even a strong signal is weighed with others; the search engine still makes the final choice.
How to declare it
In the <head> of each version, including the canonical page itself:
<link rel="canonical" href="https://www.example.com/pricing" />Mistakes Google warns about
- Using robots.txt to pick a canonical. Blocked URLs can still be indexed without their content.
- Using
noindexto choose between duplicates. It removes the page from search entirely. - Giving different canonicals for the same page through different methods.
- Relative paths in the tag. Use absolute URLs.
- Pointing a canonical at a URL fragment (
#section). - Linking internally to duplicate versions instead of the canonical one.
Canonical URLs and analytics
Search engines and analytics tools solve the duplicate problem separately. A canonical tag does not change what your analytics records; it only guides search engines.
Reveata stores the page path without the query string. Campaign parameters (UTM tags, ref and ad click ids) are read and kept for attribution, and other query parameters are not stored. So /pricing?utm_source=newsletter and /pricing count as the same page, /pricing, with the campaign recorded on the visit. Host names are stored without www., so www.example.com and example.com count as one host, while other subdomains are kept apart, as you can see in the Hostname tab of the Pages panel (Track subdomains). Trailing slash and case variants are different paths, so pick one form and redirect the other.
If you connect Google Search Console, its clicks and queries are reported per page as Google indexes it, which is usually your canonical URL.