Skip to content
Tracking and technical

What is a canonical URL?

2 min read · Updated · By the Reveata team

Short answerA canonical URL is the one preferred address you want search engines to index and show for a page whose content is reachable at several URLs, usually declared with a rel="canonical" link in the page's head.

A one way sign on a pole on a city street
Photo by Ian Taylor on Unsplash

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.

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:

html
<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 noindex to 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.

Frequently asked questions

Should every page have a self-referencing canonical?

Google recommends it: the canonical page should point to itself. It makes your preference explicit when the page is reached with extra parameters.

Do UTM parameters create duplicate content?

They can, if search engines find tagged links and index them. A self-referencing canonical on each page avoids that. Tag only links you share off-site, never your internal links.

Is a canonical tag the same as a redirect?

No. A redirect sends people and crawlers to another URL. A canonical leaves the duplicate reachable and only tells search engines which version to index.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
GlossaryWhat is an XML sitemap?An XML sitemap is a file, usually at /sitemap.xml, that lists the pages on your website you want search engines to find and crawl, optionally with the date each one last changed.GlossaryWhat is crawl budget?Crawl budget is the number of URLs on your site that a search engine's crawler can and wants to fetch in a given time, set by how much load your server can take and how much the search engine wants your pages.GlossaryWhat is a web crawler?A web crawler, also called a spider or bot, is a program that automatically fetches web pages, follows the links it finds and stores what it reads, usually to build a search engine index, an archive or a dataset.GlossaryWhat are Core Web Vitals?Core Web Vitals are three measurements Google uses to describe a page's real-world user experience, namely Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness) and Cumulative Layout Shift (visual stability).GlossaryWhat are event properties?Event properties are key–value details attached to an analytics event, such as the plan chosen or the button clicked on a signup event, so you can break one event down by those details instead of creating a separate event for every variation.GlossaryWhat is a Content Security Policy (CSP)?A Content Security Policy (CSP) is a set of rules a website sends to the browser, usually in a Content-Security-Policy header, listing which sources of scripts, styles, images and network connections the page is allowed to use, so injected or unexpected code is blocked.