Track a page's canonical URL

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.

Track the canonical URL of a page for precise pageview counts.

Canonical URLs eliminate duplicate content

Canonical URLs help webmasters and site administrators eliminate duplicate content from analytics reports.

For example,

http://www.example.com/blog

is treated as a different page than

http://www.example.com/blog?sidebar=0

even though those URLs display the same content. The side-effect is that one page view to each page is reported instead of two pageviews to a single page.


Canonical URLs in links elements

The canonical URL of a page is often specified in a canonical link element, which can be inserted into a section of a webpage.

For example:

<link rel="canonical" href="http://example.com/blog" />


How to track a canonical URL

To use your canonical URLs and override the URL that the ac SDK tracks, configure the init call to use the canonical link element value when available.

ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  canonicalLink: true
});