Track data client-side

Events tracked out-of-the-box

The following table summarizes the events tracked out-of-the-box by the Sitefinity Insight connector along with some additional information. All client-side tracking is performed via the JavaScript SDK.

NOTE: The JavaScript SDK supports HTML5 instrumentation functionality that makes reporting data to Sitefinity Insight on some interactions with the HTML elements on your page easier.
For example, you can track clicks on buttons, links, and images on your page, or expanding dropdown menus. For more information, see Enable HTML5 attribute instrumentation.

Event Predicate Object  Additional information 
Page visit  Visit 

Page URL.

You get additional metadata, such as Title, CanonicalTitle, CanonicalUrl, and others.
Play HTML5 Video  Play video  The source of the video element, taken from the src attribute.  When working with Sitefinity CMS 10.0 and newer, you also get additional object metadata for the title (with a key “PageTitle”) and URL (with a key “PageUrl”) of the page the video is played from.  
Shared on social media  Share on social media  Any social media, for example, Facebook, Twitter, or Google+. You get additional object metadata for the title (with a key “PageTitle”) and URL (with a key “PageUrl”) of the page from which the item was shared. 
Liked on Facebook  Like on Facebook  The URL of the object liked. You get additional object metadata for the title (with a key “SourcePageTitle”) and URL (with a key “SourcePageUrl”) of the source page from which the item was shared. 
Expanded list  Expand list  The HTML content of the expanded list element.
You get additional object metadata for the title (with a key “PageTitle”) and URL (with a key “PageUrl”) of the page in which the list is located. 
Toggled navigation  Toggle navigation  The name of the expanded navigation item, which is taken from the combined text contents of the expanded element.
You get additional object metadata for the title (with a key “PageTitle”) and URL (with a key “PageUrl”) of the page in which the navigation has been expanded. 
Browser and device information    

Subject metadata, sent to Sitefinity Insight:

  • Name, version, and language of the browser
  • Name, type, and manufacturer of the device the visitor uses
Came from site (referrer tracking)  Come from site  The Referer request header of the current page.
 
 
Participated in campaign (UTM parameters)  Participate in campaign  The query string containing the UTM parameters. Using the default implementation of the Sitefinity Insight JavaScript SDK. For more information, see Track Google Analytics UTM parameters.
Visited personalized page  Visit The URL of the page.

An interaction is sent to Sitefinity Insight, along with personalization object metadata. For details, see Personalization object metadata API data type » Personalization object metadata.

 
File document Download file The URL of the document

This interaction is tracked starting with Sitefinity CMS 14.1. An interaction is sent to Sitefinity Insight, along with personalization object metadata. For details, see Sitefinity Insight API data types » Personalization object metadata. You may use the following properties in the object metadata:

  • ReferrerUrl: the URL of the page
  • ReferrerType: set to “Page”
  • PageId and ReferrerId: the Id of the page.
  • SiteName: the name of the site hosting the page

NOTE: If the visitor uses their browser’s context menu to open the file in another tab, the interaction will not be tracked.

Configure the JavaScript SDK from Sitefinity CMS backend

You can change the version of the Sitefinity Insight JavaScript SDK your website is using. To do so, in the Sitefinity CMS backend, navigate to Administration » Settings » Advanced » Pages » Script Manager » Script reference » DecJsClient » Path. For more information about how to get the JavaScript SDK from a CDN, see Capture client-side behavior with JavaScript SDK » Start the SDK.

Obtain an instance of the JavaScript SDK in Sitefinity CMS

In cases when the events tracked out-of-the-box do not serve the needs of a more complex scenario, you can access the instantiated Sitefinity Insight JavaScript SDK client on your pages. The client is saved under the window.DataIntelligenceSubmitScript._client variable via which you have access to all existing clients, for example, data collection, personalization, and others, provided by the JavaScript SDK. For more information, see Capture client-side behavior with JavaScript SDK.

IMPORTANT: We strongly recommend using the Sitefinity CMS-provided instance of the JavaScript SDK, instead of instantiating it on your own.

To use any of the clients, listed above, make sure that the window.InsightInitScript._client is properly loaded. In the following example, this is indicated by raising the decclientready event:

Following is an example of how to send an interaction to Sitefinity Insight when a visitor clicks a particular button on your page. You can insert the code on the page via a JavaScript widget.

Sub-domain tracking

If you are using newer versions of Sitefinity (i.e. 8.0 or newer) you will be able to use the cookie management features of the Sitefinity Insight JS SDK in order to track your users across all of your subdomains by setting the domain of the Sitefinity Insight JS SDK cookie from Administration » Settings » Advanced » DigitalExperienceCloudConnector » Tracking cookie domain. For example, if your main website mysite.com has several sub-domains, like music.mysite.com, movies.mysite.com and books.sitefinity.com, and you wish to track the person’s interactions across all of them, you should set the domain of the JS SDK cookie to .mysite.com. For more information, see Manage cookies.

Cross-domain tracking

You can implement cross-domain mapping across your Sitefinity CMS sites. You track two sites hosted under different domains and one of the domains is the mapping domain. For more information, see Track interactions across Sitefinity CMS sites.

Was this article helpful?

Next article

Track data server-side