You are here

santianoEvent - SEO - CanonicalUrl

Container Reference: 
Tag Type: 
Custom HTML
Tag Description: 
Sends a santianoEvent for detected issues with canonical URLs
	<script>
var seoTestUrlCurrentIsNotCanonical = {{seoCanonicalUrlNotMatchingCurrentUrl}};
var seoTestMissingCanonical = {{seoCanonicalUrlIsMissing}};
// moz has a good video for you here
// https://www.youtube.com/watch?v=1GX9KylnBtQ
// canonical tests
if (seoTestMissingCanonical) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringCanonical',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is missing its canonical',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
  
} else if (seoTestUrlCurrentIsNotCanonical) {
  dataLayer.push ({'event': 'santianoEvent',
                   'eventCommand': 'seoMonitoringCanonical',
                   'eventCategory': 'SEO Monitoring by santiano.io',
                   'eventAction': 'Page is not matching its canonical tag',
                   'eventLabel': '{{seoUrlCurrent}}'
                   // 'eventSegment': undefined,
                   // 'eventPartition': undefined
                });
}  

</script>