What is a canonical URL

This document explains the canonical URL.

What is canonical URL

The canonical URL refers to the URL of the page that is considered the most representative of several similar pages.

For example, if you have multiple URLs on the same page(https://channel.io/en/pricing, https://channel.io/en/pricing?show=true), one of them could be the canonical URL.

ChannelTalk SDK inquires about the canonical URL through the following process.

  1. The SDK inquires about the href property of the link tag with the value of the rel property as “canonical”.
<link rel="canonical" href="{canonicalUrl}" />
  1. If no link tag satisfies the condition above, the SDK inquires about the URL.

You can test whether the SDK inquires about the canonical URL appropriately.
See the canonical URL for more details.

Why should we use the canonical URL

The canonical URL helps process statistics.

For example, suppose there are the two following URLs.

  • https://channel.io/en/pricing
  • https://channel.io/en/pricing?show=true

The SDK is not sure if the two URLs show the same screen. Therefore, they are regarded as separate URLs in collecting data, such as the inflow statistics.

However, if the canonical URLs are the same, the SDK will know that both are showing the same screen.

Integrating the screen information for these similar pages into a single canonical URL can reduce noise and achieve the desired result when using the information statistically.

See why the canonical URL matters for more details.

When to use the canonical URL?

The SDK uses the canonical URL by the default value of the page instead of the URL.

The page is used to send specific events or to show specific support bots.
You should set the canonical URL properly to use the event and support bot.