Tracking Code Atlas

When to use the ClickTale Tracking Code
Implementing ClickTale on your site can be as easy as copying and pasting a few lines of HTML into your web page.

The ClickTale tracking code shown here is used for all standard HTML webpages, both HTTP and HTTPS, and is generated in a few simple steps on your ClickTale account.

Below we will explain how to generate your code and perform a standard installation.


 * For non-standard, session-based or dynamic pages, please use the relevant plugin or integration module.
 * If you are hosting the tracking code locally on your server, please read this article to keep your code up-to-date.

How to Generate the ClickTale Tracking Code
The first step of implementation is to generate your tracking code.


 * If this is a new project, click the "Get started" button on the Projects page. If your project has already been created, click the "Setup & Code" link below the project name.

Step 1 - Project Details Step 2 - Recording ratio setup Step 3 - Recommendation and Tracking Code
 * Specify the domain you will be recording, name your project and select the industry type of the site.
 * If your site uses features such as dynamic elements, a shopping cart or POST pages that you would like to record, then check all the boxes that apply to your site under "Website Infrastructure". If not, check the "None of the above" checkbox.
 * If you have checked any of the features above, you will be asked to specify your site's architecture by selecting from the drop-down list. Choose the correct platform or click "Go" to allow our automated service try and determine your site's architecture, if you don't know it.
 * Click "Next".
 * Try to estimate roughly, how many pageviews your site gets per day or week. Type the number into the Traffic field, or select "Don't know" if unsure.
 * If you want, you can type in a Recording Ratio of your choice in the "Choose your Recording Ratio" field. Values are in whole numbers and indicate percentage of visitors to be recorded by random selection.
 * Mark the "Secure pages" checkbox if you want to record both HTTP and HTTPS/SSL-secured pages from your site. If you leave the box unchecked, only HTTP pages will be recorded.
 * Click "Next".
 * If you chose any architecture options for your site, you will be shown a recommendation at the top of the page. This will advise which implementation of ClickTale will allow you to get the most useful data recorded. The recommendation has a link to an integration module for your site's architecture, which will enhance your implementation of ClickTale.
 * Below that, you can see the two sections of the tracking code created for your project.

Once your tracking code is generated, you will need to paste the top and bottom code snippets into your source code. Below are examples of the standard code placement on the pages.

Top Part
The top part of the code is a time stamp and does not load any scripts. While it's not necessary to have the top code, it is recommended. The top code should be placed after the opening body tag.

Example top code and placement:

Bottom Part
The bottom part of the code loads the ClickTale recording script. It is recommended to place it after your page's content (so that the script loading does not affect the loading of other elements on your page) and before the closing body tag.

Example bottom code and placement (HTTP only code): Note: "WRe2.js" references the ClickTale Web recorder. The file name changes with updated recorder versions. Older file names are automatically mapped to the newest recorder version.

Example of HTTPS enabled code:

Modifying the Recording Ratio for an Existing Tracking Code
Changing the recoding ratio for tracking code that has already been deployed onto your pages can be done in either of the two following manners:
 * Manually changing the [RecordingRatio] parameter value to a number of your choice, where 1=100%, 0.5=50% etc. Please note that this should be done for ALL pages where the tracking code exists, and that other parameters of the ClickTale function should be left intact.
 * Going through the Tracking code generation process again, and selecting the desired recording ratio.

Using the ClickTale Script in an External JavaScript File
You can place the ClickTale tracking code in an external file, keeping a single copy of the code, rather than implement it in every page. Prior to choosing this option, please make sure that you are not already using an option which keeps one centralized instance of the code, such as an Integration Module or a plugin.

NOTE - If your project is a Balkan code project, see this section.

Benefits
Using an external file has the advantage of flexibility: While regularly you need to repeat steps 6 and 7 for every page you want to record, to make a change in the tracking code (for instance alter the recording ratio, or switch to HTTPS/SSL compliant code), in the case of an external JS file, you only need to change the top/bottom files once.

Implementation - HTTP Code
 Generate the tracking code for the relevant project. Create two separate JavaScript files named "top.js" and "bottom.js" and put them in the root of your website. Place the following code in the "top.js" file :  Place the following code in the "bottom.js" file:  Change the [project id],[ratio] and [partition] to the values found on the tracking code you generated in step 1.

PLEASE NOTE: You can modify and change the code in the bottom.js file to fit your needs (for instance you might want to include calls to API commands), however, if you do so make sure not to include the single quote (') character inside the document.write commands. 

Access the web-page you wish to put the ClickTale code in and add the following code after the tag: top.js can be replaced with the correct full/relative path for the top.js file. Place the following line just before the tag:  

Implementation of HTTPS Enabled Code
This option will work for both HTTPS and HTTP pages. Use of this option is only needed if you have HTTPS pages in your site. Please note that recording of HTTPS pages is not available for the Free plan.

Perform steps 1-3 from previous section.

In stage 4 use the following "bottom.js": Perform steps 5-7 from the previous section.

XHTML-Compliant Code
Important note: You must contact ClickTale support if you wish to use the XHTML-Compliant version of the code. A special definition on the ClickTale server is required in this case.

If you need to use an XHTML-Compliant version of the Atlas code, please use the following (Replacing "PID, Ratio, PartitionPrefix" with your project's parameters):

Additional notes
* Relevant APIs - ClickTaleGetVersion, ClickTaleScriptSource, ClickTaleIncludedOnDOMReady
 * You may exclude certain pages from being recorded by not including the ClickTale code in the page’s HTML.
 * You can filter recordings, using the PHP Control Script. The script allows you to control exactly who you want to record. You may download it and view instructions for its implementation in the PHP Control Script article.
 * ClickTale does not display or record passwords by default.
 * ClickTale censors keystrokes in forms that weren’t submitted.
 * You can change your page’s recording ratio by generating a new tracking code, or by manually changing the ClickTale code on your site as explained here.
 * It is highly recommended to block form fields which hold personal or sensitive information, such as credit card numbers. To learn how to hide specific fields from ClickTale, click here.
 * You are required to disclose your use of ClickTale in your privacy policy. View terms here.