A canonical is a short unique path identifier for a page on your website.
The canonical is used to create a named permalink in order to get quickly to a page without knowing its full path
Example:
https://yourdomain.com/your/canonical
The canonical path can be used as path in the canonical url.
The canonical path can be used in your tracking metrics in order to aggregate the page view even if the page:
You can:
The canonical path should have a meaning and be understandable by humans.
The canonical value:
This page has the canonical value set to canonical and therefore is also available at the following named permalink. https://combostrap.com/canonical
You can try it your self.
Navigate to this page via its canonical URL !
or
To set the canonical value, uses the metadata manager and set the canonical property in a wiki path format (ie the path separator should be a colon)
Example:
my:path
You can also create a canonical value based on the last parts of a page path. See Automatic Canonical Path
If you want to retrieve the canonical value to add it to your tracking_metrics, you can access it via the JSINFO javascript variable.
Example:
console.log(`The canonical for this page is '${window.parent.JSINFO["canonical"]}'`);
You can send the canonical path as page identifier to Google Analytics.
For further information, see the Google Analytics Pageview section