Selective recordings

=Overview=

In some scenarios, you may wish to exclude certain visitors from being recorded by ClickTale. Those visitors may be internal (yourself and other company employees) or external (visitors from specific countries, IP ranges and so on).

Several methods allow you to achieve this goal with ClickTale:

Block recording by IPs in ClickTale UI
An option to block IPs and IP ranges is available under the Project Settings > Advanced Settings sub-menu.


 * 1. Open the Advanced Settings page for the relevant project.


 * 2. Scroll down to the Block IP Range section.




 * 3. Click the ADD NEW IP button and fill in the IPs to be blocked.

This section allows you to define IPs for blocking using 3 methods, which can be used in conjunction:


 * 4. Click the SAVE button at the bottom of the page.

Your settings are saved, and depending on the action you will get a message - "Project settings updated successfully." or "Changes to IP blocking settings will take effect in a few minutes." (if you updated or removed any blocking definitions).

Selective Recording via URL Parameters
This method is particularly useful for preventing you or others in your organization from generating recordings on your ClickTale Account. This way you could save credits and reduce irrelevant information. Forcing a recording can also help you test ClickTale as it lets you see results faster, without waiting for visitors to arrive and generate recordings based on the tracking code's recording ratio.

If your website's URL is http://www.example.com/ then: The above calls will set a persistent cookie to keep track of your selection. You will be recorded or not recorded for as long as the cookie is in place (subject to recording quota).
 * To force a recording, visit  http://www.example.com/?ct=enable .
 * To disable recording, visit  http://www.example.com/?ct=disable .

Please note: If your domain is not checked in the "Domain Management" page in your account, then the recording will be blocked even though the status window reports that recording has started.

The debug parameter
Adding the debug parameter pops a window which enables you to view the recording initialization process. It can also be used in conjunction with the ct parameter listed above:
 *  http://www.example.com/?ct=enable,debug .
 *  http://www.example.com/?ct=disable,debug .

Selective Recording via the PHP Control Script
The ClickTale PHP control script is intended to help determine which visitors will be recorded by ClickTale and which will not. It allows you to set filters based on the following visitor metrics: For more information, please see the PHP control script page.
 * Time
 * Day of the week
 * IP address (including IP mask)
 * Country
 * Referrer
 * URL

The PHP control script can work on ASP.NET sites as long as the webserver used is able to run php code.

Advanced Selective Recording via Customized Tracking Code
The following example is of a tracking code which determines whether to record a visitor or not, based on the page URL. It can be modified to use any visitor parameter which can be discerned during the visit (such as browser, referrer, etc.). Please note: This code alters the tracking code's recording ratio. The ratio is only taken into account when the visitor is not classified (has no WRUID cookie set), if a visitor arrives at a page with a WRUID value different from 0 they will be recorded, even if the recording ratio is 0. Similarly if a visitor arrives at a page with a WRUID=0 they will not be recorded, even if the recording ratio is over 0. Used alone (without additional code), this code is useful in situations where you want different recording ratios for different landing pages for your website (so for instance 95% of visitors arriving from landing page A will be recorded, while only 15% of those arriving from landing page B).

To use this option, replace the existing bottom tracking code on your pages with the following code:  

function escapeRegex(text) { if (!arguments.callee.sRE) { var specials = [ '/', '.', '*', '+', '?', '|',           '(', ')', '[', ']', '{', '}', '\\'        ];        arguments.callee.sRE = new RegExp(            '(\\' + specials.join('|\\') + ')', 'g'        ); }   return text.replace(arguments.callee.sRE, '\\$1'); }

function urlPathIs(urls) { /// Check if the current url matches any of the given urls passed /// A url or an array of urls to test against /// True if the the current location matches any of the passed urls, false otherwise if(arguments.length > 1) { urls = Array.prototype.slice.call(arguments, 0); }   if(typeof urls == "string") { urls = [urls]; }   var escapedUrls = [], regexp; for(var i = 0; i < urls.length; i++) { escapedUrls.push(escapeRegex(urls[i])); }   regexp = new RegExp("^(?:"+escapedUrls.join("|")+")/?(?:\\?|$|#)","i"); return regexp.test(window.location.href); } Next, an if/else statements (or a switch statement)needs to be added to determines the recording ratio according to the current URL. This next bit is an example of a user who wants to record 100% of visitors to his homepage and his contact page, and non of the visitors to other pages. You are able to set a different value in the recording ratio. var recordingratio = 0;

if (urlPathIs ("http://domain.com","http://www.domain.com","http://domain.com/contact","http://www.domain.com/contact")) { recordingratio = 1; } Finally, once the ratio is determined, you can place it in the recording function as it appears in the standard tracking code (in this case it's for a regular page, https pages and other special cases require a different code but the concept is the same): if(typeof ClickTale=='function' && recordingratio>0) ClickTale([!YOUR PROJECT ID!],recordingratio,[!PARTITION!]);

The [!YOUR PROJECT ID!] and [!PARTITION!] parameters should be replaced with the values of the specific ClickTale Account- These are found in the Standard tracking code as well.