Integration module

The full list of integration modules can be found on our Plugins and Integrations page.

Introduction
An "Integration Module" is a type of ClickTale integration that is platform specific and based on adding a code library to the website. Such a module resolves several issues related to using ClickTale on a dynamic site and generally simplifies ClickTale integration and procedures.

With an integration module you'll be able to use ClickTale for recording pages that cannot be recorded with the standard tracking code, including password protected pages, pages that depend on session cookies and POST processed pages. A typical module provides: The benefits of using a module are:
 * Automatic injection of the ClickTale scripts to all pages, prior to them being rendered to the visitor.
 * Automatic capturing of page content and temporary caching.
 * Having a single location for your ClickTale scripts - which allows for easier maintenance of the code.
 * As mentioned - the ability to easily record pages which could not be recorded with the standard code.

Platforms
ClickTale currently offers Integration Modules for the following platforms:
 * PHP
 * ASP.net
 * J2EE

Basic operation flow

 * The module is installed on the web site's platform (server side) as another filter and captures all page content as it is generated by the server.
 * Recorded Page views are stored in a "cache storage provider" that is configurable and depends on the module used.
 * The ClickTale tracking code is injected onto the page prior to being sent to a recorded visitor. In case the visitor is not selected to be recorded (WRUID=0) the code is not injected onto the page.
 * The tracking code performs tracking of visitor activities on the client-side.
 * The ClickTale Bot("fetcher") makes an HTTP request to the module in order to receive the stored ("cached") page content. It is directed to the correct location.
 * The stored content is deleted after being fetched or after a certain time - depending on the specific configuration.

Usage with Load Balancers
Most integration modules default to using a local (often in process memory) storage for storing the temporarily cached pageviews. This content is later requested by the ClickTale servers via HTTP(S)requests. When using more than one server and using a load balancer to distribute the requests across servers there is a chance that the ClickTale bot will be forwarded to a different server from the one to which the visitor had been forwarded to. As a result the bot will hit a server that doesn't contain the requested information causing the recording to fail with a 404 error. Therefore, a load balancing configuration should include one of the following or
 * A way to force the request from ClickTale to reach a specific server in the farm
 * A centralized caching location

Using direct host for fetching
If you have a dedicated host for each server in the farm, and you can access the resources of the web site by going to a direct URL, you are able to set ClickTale to fetch from a specific server. To do so you would customize the ClickTaleFetchFrom URL of each server to specify a direct URL to that server. For example if having a site  http://www.site.com/  and servers  http://s1.site.com/ ,  http://s2.site.com/  then you would need to change the bottom tracking code on each server to include a ClickTaleFetchFrom URL referrer to the specific server directly.

Using cookies for accessing a specific server
Some load balancers use an HTTP cookie to assign a specific visitor to a specific server permanently. This method is often referred to as "Sticky sessions". If you are using this method, you could 'instruct' the ClickTale bot which server to fetch from, by recording the cookie value. To achieve this, please see FetchFromWithCookies (note the section: 'Specifying a URL' for merging the integration module URL with the FetchFromWithCookies code).

A Centralized Cache Location
Most integration modules provide an option to use a centralized caching location. When using a centralized location, all cached entries are available to all servers and correct fetching of the cached pages is achieved even if the ClickTale bot reaches a server different from the one reached by the visitor. Examples of centralized caching providers:
 * SQLServer for the ASP.NET integration module
 * MySQL for the PHP integration module
 * EHcache for the J2EE integration module

Usage with a (reverse) proxy server
In case a reverse proxy is used, it could change the request in such a way that it seem to originate from the proxy and not from the ClickTale servers. This will prevent the module from authenticating the request and a 403 response (Request from an unauthorized IP) will be sent. There are two ways to work around this. or
 * Change the AllowedAddresses value in the configuration file of the module and add the IP of the proxy as one of the allowed addresses. To prevent any request from having access to the module, please be sure to configure your proxy to block any IPs that are not that of ClickTale's from accessing the Integration Module.
 * Available for some of the modules: in case the proxy provides the original IP address of the request in the HTTP headers, you can instruct the module to use that header for identification. See specific module documentation for instructions on configuring "X-Forwarded-For" (or another header) as the IP source.

''' Please note that failing to implement the above security measures causes a potential security breach to your website. Please ensure that you have taken the necessary steps. Contact ClickTale support if you have any questions.'''

Tracking code not injected in to the HTML of the page
First please check that the module is installed correctly by using the debugging/troubleshooting functionality of the module. If the debug page states that the installation is correct, please check if you are browsing with a WRUID cookie set to value '0'. Having WRUID=0 means that you are classified as "not to be recorded". The ClickTale tracking code will classify visitors as "to record" and "not to record" based on the recording ratio set during the tracking code generation process. Most integration modules are configured in such a way that they will not inject the tracking code to the page if the visitor is classified as "not to be recorded".

Receiving 404 Error messages in Recordings
Some websites use "cache-control" and "expires" headers to cache pages on the client side. This improves performance but may be problematic when used with an integration module.

By default, pages are removed from the module's cache immediately after they have been fetched by the ClickTale bot (for security and performance reasons). As a result the content will be deleted after the first pageview of the content is recorded. Recording subsequent pageviews will result in a cache miss (for the ClickTale bot, not the visitor). This is often the case when a visitor browses a page more than once without refreshing the content from the server (usually a result of using the back button).

To overcome this problem, see the specific module configuration to set the DeleteAfterPull parameter. when set to "false" the immediate removal of cached pages is disabled. Cached data will be removed when the MaxCachedPages or MaxCachedSeconds limitation(depending on module and storage provider) is reached.

Additionally, you can change your HTTP cache control to "no-cache" which may serve your site better.

Preventing Crawling of Pages in the Module Cache Location
The cached URLs are not accessible to search engines. If you are concerned about any theoretical impact to SEO you are able to block cached URLs from being accesses by bots via a robots.txt file (or if you already have one, by modifying it).

Please see this Google article for an explanation about the robots.txt file and this guide for examples of its use. The part preventing the crawling of the cache should look something like: User-agent: *  Disallow: [CLICKTALECACHELOCATION] 

Where CLICKTALECACHELOCATION is the location of the module's cache.

Another option is to set the following parameter in config.php - $config['FetcherUnauthorizedURL'] = ""; where the URL is in the " ". Any unauthorized attempt to access ClickTaleCache.php (bots) will be redirected to the URL specified. Leave blank for no redirection.