Table of Contents
Adding your Tracking Script to your website will enable Click Web Tracking, so you can see real-time information on who's visiting your site. If you would like to track multiple websites, instructions on how to do so can be found in this article.
If you have not done so already, you need to first set up your domain(s) for Web Tracking to work.
NOTE: On January 22, 2017, Click updated the web tracking script in order to remove some functions that are being deprecated by some browsers. The older script will continue to work for most browsers for some time, however it is important to update your script as soon as possible. If you added the tracking script to your site prior to this date, we recommend updating the script.
- Dynamics 365
- Legacy View
Navigate to Tracking Script
Locate your script by going to Settings and Support > ClickDimensions Settings. Once there choose Tracking Script.
Basic Website Tracking Script
When you click on Tracking Script, you will see your unique script. An easy way to add your script is to place it into your global footer file or any other mechanism that causes it to be placed on each page. (However, if you will be integrating with Gravity Forms or if you have a unique scenario where the script should not be on every page, we strongly suggest adding the tracking script to each page individually rather than using a global footer.)
It is best to place the JavaScript toward the bottom of the page and always before the end body tag </body> for the page.
NOTE: If the script is being placed on a site that has a different domain than what is in the cdAnalytics.setDomain parameter then change that text to the domain of the site when you place the script on the site. For example, the tracking script shown above has the following line: cdAnalytics.setDomain('clickdimensions.com'); If your website is at www.mycompany.com, you will change the line in the script to: cdAnalytics.setDomain('mycompany.com'); You will also need to create a domain record in CRM correcponding to the domain the script resides on.
NOTE: If you would like to put a score of zero (0) on specific pages, you'll need to replace your tracking script with the current one (shown above).
Opt-Out Website Tracking Script & Opt-Out Dialog Customization Script
As of Click version 9.2.0 (8.2.2 for CRM 2011 users), we now offer an alternate "Opt-Out" Web Tracking script which includes the functionality to notify web visitors about tracking and provide them with the opportunity to opt out. Click here to learn more about the Opt-Out Tracking Script.
Optional Scripts
There are three additional optional scripts below the tracking script.
Give Certain Page(s) a Different Score
Legacy Lead Scoring (articles here)
This script can let you set a specific score for a certain page other than what you set in your overall Score Settings. Simply add the following three lines of script to the pages whose score you would like to override, and set the value of cdScore to whatever you want the score for the page to be. Note that the score value can be negative by adding the “–“ symbol directly before the score value. For example, the JavaScript could be "var cdScore = -25;". You may have as many custom scored pages as you like.
The script should be placed before the base tracking script.
New Lead Scoring (articles here)
This script can let you set a specific score for a certain page other than what you set for all page views in your Score Model. Simply add the following three lines of script to the pages whose score you would like to override, and set the value of cdScore to whatever you want the score for the page to be. For example, the JavaScript could be "var cdScore = 15;". You may have as many custom scored pages as you like.
The script should be placed before the base tracking script.
Priority Page(s)
The second script can be placed on a page to highlight that page in the tracking summary on lead and contact record profile pages. They will show up as Page Views (other pages will not do this by default) and along with the Visit(s) they're associated with. 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’. By the way, if you make multiple pages priority pages, the most recently accessed will float to the top.
Associate Page(s) with a CRM Campaign
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. The campaign code is case-sensitive. If you customized a campaign code, it can still work with this tracking. Please just make sure the case matches exactly (i.e., special1 and SPECIAL1 will not be considered the same). This script should also be placed above the tracking script in the page's HTML.
The Campaign Code is found in the Campaign record as highlighted below. Please use this value instead of the example Campaign Code in the code above.
Navigate to Tracking Script - Dynamics 2013/2015/2016
Locate your script by going to Settings > ClickDimensions Settings.
Now choose Tracking Script.
Basic Website Tracking Script
When you click on Tracking Script, you will see your unique script. An easy way to add your script is to place it into your global footer file or any other mechanism that causes it to be placed on each page. It is best to place the JavaScript toward the bottom of the page and always before the end body tag </body> for the page.
NOTE: If the script is being placed on a site that has a different domain than what is in the cdAnalytics.setDomain parameter then change that text to the domain of the site when you place the script on the site. For example, the tracking script shown above has the following line: cdAnalytics.setDomain('clickdimensions.com'); If your website is at www.mycompany.com, you will change the line in the script to: cdAnalytics.setDomain('mycompany.com');
NOTE: If you would like to put a score of zero (0) on specific pages, you'll need to replace your tracking script with the current one (shown above).
Opt-Out Website Tracking Script & Opt-Out Dialog Customization Script
As of Click version 9.2.0 (8.2.2 for CRM 2011 users), we now offer an alternate "Opt-Out" Web Tracking script which includes the functionality to notify web visitors about tracking and provide them with the opportunity to opt out. Click here to learn more about the Opt-Out Tracking Script.
Optional Scripts
There are three additional optional scripts below the tracking script.
Give Certain Page(s) a Different Score
This script can let you set a specific score for a certain page other than what you set in your overall Score Settings. Simply add the following three lines of script to the pages whose score you would like to override, and set the value of cdScore to whatever you want the score for the page to be. Note that the score value can be negative by adding the “–“ symbol directly before the score value. For example, the JavaScript could be "var cdScore = -25;". You may have as many custom scored pages as you like. The script should be placed before the base tracking script.
Priority Page(s)
The second script can be placed on a page to highlight that page in the tracking summary on lead and contact record profile pages. They will show up as Page Views (other pages will not do this by default) and along with the Visit(s) they're associated with. 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’. By the way, if you make multiple pages priority pages, the most recently accessed will float to the top.
Associate Page(s) with a CRM Campaign
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. The campaign code is case-sensitive. If you customized a campaign code, it can still work with this tracking. Please just make sure the case matches exactly (i.e., special1 and SPECIAL1 will not be considered the same). This script should also be placed above the tracking script in the page's HTML.
The Campaign Code is found in the Campaign record as highlighted below. Please use this value instead of the example Campaign Code in the code above.
Feature Added: Original |
Feature Updated: 9.2.0 (8.2.2 for CRM 2011) |
Click Version Needed: Any |