Track interactions across multiple domains
Overview
With Sitefinity Insight, you can track visitors' interactions across websites hosted on multiple domains. Thus, you better understand the customer journey that may span across different websites and understand how digital resources and the different types of visitors on your sites affect marketing goals.
Sitefinity Insight internally uses a cookie to track visitor’s journey across multiple sites. However, the browser security model binds cookies only to a single domain. Thus, the visitor journey breaks, and a single person looks like multiple visitors – each one bound to a single domain.
In this article, you learn how to configure Sitefinity CMS and Sitefinity Insight to track visitors across multiple sites, whether they are hosted in Sitefinity CMS or not. The goal is to ensure that one and the same physical visitor who browses more than one of your web sites, hosted under different domains, is recognized as one and the same Sitefinity Insight visitor and not as different Sitefinity Insight visitors for each domain.
Cross-domain tracking works in the following scenarios:
Configure Sitefinity CMS 14.3 and higher
By default, Sitefinity CMS tracks visitors across domains that are hosted on it.
Additionally, you can configure Sitefinity CMS with a list of external (that is, non-Sitefinity) domains on which site visitors should be tracked as a single visitor. Perform the following:
- In Sitefinity CMS backend, navigate to Administration » Settings » Advanced » DigitalExperienceCloudConnector.
- To enable cross-domain tracking, check the Enable cross-domain tracking checkbox.
- Under Cross-domain tracking of external domains, enter a comma-separated list of external domains.
For example, mydomain.com, example.com
- Click Save changes.
With this configuration, you can track visitors whose journeys are within sites hosted on Sitefinity CMS or who navigate from a Sitefinity CMS site to an external one.
To enable tracking visitors whose journey starts on external sites, see below.
Configure Sitefinity CMS versions up to 14.2
Previous versions of Sitefinity CMS do not have built-in facilities for cross-domain tracking across external sites but you can implement this manually.
Essentially, you need to add a small JavaScript snippet to every page on your site. The easiest way to do this is to modify the page template on which the pages are based.
Perform the following:
- In the Sitefinity CMS backend, navigate to Design » Page templates.
- Open the page template you want to modify.
- Drag and drop a JavaScript widget on the page editor.
- Paste the following JavaScript into the widget.
- Modify the
crossDomainTrackingEntries
array to enlist all your domains on which you want to track visitor journeys.
- Expand More options and under Where to include in HTML? select In the head tag.
- Click Save.
- Publish the page template.
Perform the procedure above for all page templates you are using on your site.
Configure external (non-Sitefinity CMS) sites
PREREQUISITES: To enable cross-domain tracking of external sites, the following conditions must be met:
- You must use Sitefinity CMS 14.3 or higher
- Source and target sites must report in the same data center
- Domains are automatically listed for Sitefinity CMS sites only when the site is online and not protected by the Site Shield module
You can enable cross-domain tracking on external sites manually. To do this, invoke the Sitefinity Insight JavaScript SDK and fill in the parameter crossDomainTrackingEntries
in its constructor. For more information, see Capture client-side behavior with JavaScript SDK.
However, we recommend using Google Tag Manager (GTM) instead. This method requires no coding and is easy to perform even by non-developers. If you already have GTM on your sites, perform the following:
- Navigate to the GTM console and click your container.
- Click Tags » New.
- Click Tag configuration
- On the menu on the right select Sitefinity Insight.
- In Domains for cross-domain tracking, enter a comma-separated list of external domains.
For example, mydomain.com, example.com
This option is visible only when Use this tag only on Sitefinity CMS sites checkbox is not checked.
- Save the changes and name your tag.
Troubleshoot cross-domain tracking
To validate that the cross-domain tracking is set up correctly, perform the following:
- On your site, log in as a known contact.
- Visit a page on your site.
- Follow a link to a site hosted on a different domain.
This site can be external, a site in the same Sitefinity CMS instance, or in another Sitefinity CMS instance, but it must use another domain.
- Validate the URL of the second site you visit.
If the tracking is set up properly, it must contain the query component instrck
with a Base64 encoded Insight tracking data.
In Sitefinity Insight, check the properties of the contact you are testing with.
If the tracking is set up properly, you see the two pages you have visited recorded in the contact’s journey. For more information, see Contacts.