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.

When working with Sitefinity CMS 10.0 and newer, you also 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+. 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 from which the item was shared. 
Liked on Facebook  Like on Facebook  The URL of the object liked. When working with Sitefinity CMS 10.0 and newer, you also 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.
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 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.
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 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.

When working with Sitefinity CMS 10.1 and newer, this event is tracked client-side - an interaction is sent to Sitefinity Insight, along with personalization object metadata. For details, see Personalization object metadata API data type.

When working with Sitefinity CMS 10.0 and older, this event is tracked server-side.
 

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, navigate to Administration » Settings » Advanced » Pages » Script Manager » Script reference » DecJSClient » Path. For more information about how to get the JavaScript SDK from CDN, see Get the JavaScript SDK.

NOTE: You can change the JavaScript SDK version only if you are working with Sitefinity CMS 8.0 or a newer version.

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: Capture client-side behavior.

IMPORTANT: We strongly recommend to use 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.DataIntelligenceSubmitScript._client is properly loaded. In the following example, this is indicated by raising decclientready event:

Following is an example 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 Tutorial: Track interactions across Sitefinity CMS sites.

Was this article helpful?

Next article

Track data server-side