Ignoring a Canonical URL

In this article we explain how to ignore a canonical link element, otherwise known as a canonical URL. 

A canonical link element is an HTML element that helps webmasters prevent duplicate content issues by specifying the "canonical" (i.e. preferred) version of a web page.  Sites use a canonical link to group pages together for Search Engine Optimisation. 

To check whether your page contains a canonical link, please see the following help article.

Why do I need to ignore a canonical link?

This is relevant as canonical links are a common reason why SessionCam will not initiate recording on a page.  

When the SessionCam tag fires it initiates a check to confirm the recording configuration of the page, including checking the page URL is what the console is set up to record.  

By default, SessionCam will assume a canonical URL is the URL which it should be recording and if this doesn’t match the URL stated in the configuration, then recording will not start.

To ignore a canonical link you need to add a single line of JavaScript which tells SessionCam to ignore any canonical URL on a page.  

Please see an example of how to add this code to your HTML:

<script type="text/javascript">
window.sessioncamConfiguration = { IgnoreCanonicalLink: true };