Export
Export
Tracking Script
Tracking Script Examples
The following example contains the base tracking script that should be placed in all web pages you would like to be tracked by the ClickDimensions service. It is recommended to place the script at the bottom of your web pages before the closing BODY tag. If you use a global footer you may place the script within the global footer as long as the footer is inserted before the closing BODY tag of your pages. Please note that this script already contains your customer-specific Account Key so it is ready to use. Don’t forget to also create the domain record for any sites you choose to track with ClickDimensions. To configure the domain records add one or more Domain entity record. These can be found under Settings > ClickDimensions > Domains.

<script type="text/javascript" src="https://analytics-eu.clickdimensions.com/ts.js" > </script>

<script type="text/javascript">
  var cdAnalytics = new clickdimensions.Analytics('analytics-eu.clickdimensions.com');
  cdAnalytics.setAccountKey('aZYsMnBwuHkiDhP8C3Tgg7');
  cdAnalytics.setDomain('kompan.com');
  cdAnalytics.setScore(typeof(cdScore) == "undefined" ? 0 : (cdScore == 0 ? null : cdScore));
  cdAnalytics.trackPage();
</script>
You can insert a script parameter to override the default score for specific web pages. Simply add the following three lines of script to the pages whose score you would like to override. The script should be placed before the base tracking script. Note that the score value can be negative by adding the “–“ symbol directly before the score value. For example, the javavscript could be “var cdScore = -25;”. You may have as many custom scored pages as you like.

<script type="text/javascript">
  var cdScore = 5;
</script>
You can insert a script parameter to highlight specific pages in the Tracking Summary of the Profile pages. Simply add the following three lines of script to the pages you would like to highlight. The script should be placed before the base tracking script. These are referred to as ‘priority pages’.

<script type="text/javascript">
  var cdPriority = true;
</script>
Page Views and Visits can be automatically associated with Campaign records in Microsoft CRM. Simply add the following three lines of script to the pages you would like to associate with CRM campaign records. Be sure and substitute the campaign code listed below (i.e. CMP-01005-ZBPTHS) with the CRM generated campaign code to which you would like the Page Views and Visits associated.

<script type="text/javascript">
  var cdCampaignKey = 'CMP-01005-ZBPTHS';
</script>