Ruby on Rails Integration Module

The RoR Integration Module enables full integration of ClickTale with dynamic, session-based, behind-a-login and POST-processing pages. It is aimed at sites that use dynamic content that changes independently for each user, for example, shopping carts. The module enables you to store the exact version of a page accessed by a user, and then, using the Fetcher mechanism, you can retrieve that version for playback and analysis.

The ClickTale RoR IM package holds the files required for installation of the module.

Prerequisites
The following prerequisites must be in place before starting the integration process:


 * Ensure any existing ClickTale code is removed and disable other integration methods
 * Make sure you have the following software versions:
 * Ruby: 1.8.7
 * Rails: 2.3.2


 * Make a note of IP addresses of load balancer and reverse proxy for property configuration at a later stage
 * If the load balancer maintains affinity by cookies, make a note of the cookie name
 * Decide on the recording ratio. Recording ratio is the number of visitors that will be recorded in percent (expressed as a floating point number between 0 and 1). It is calculated as the ratio between the amount of recordings available in the selected ClickTale subscription plan and the amount of pageviews on pages of interest.

Installation
To install the RoR integration module:
 * 1) Download the IM installation package from https://github.com/clicktale/RoR-Integration-Module/
 * 2) Create a directory called ClickTale inside your app_root/vendor/plugins directory.
 * 3) Extract the contents of the IM installation zip file into the ClickTale directory.
 * 4) Copy the ClickTale.yml file from app_root/vendor/plugins/ClickTale/config directory to app_root/config.
 * 5) Add a cron job (crontab -e) that will take care of the old cached files:

 */ 30 *  *  *  *  find <span style='color:navy'>/ </b> path <span style='color:navy'>/ </b> to <span style='color:navy'>/ </b> your <span style='color:navy'>/ </b> application <span style='color:navy'>/ </b> public <span style='color:navy'>/ </b> clicktale <span style='color:navy'>/ </b> <span style='color:navy'>- </b> type <span style='color:black'> f  - <span style='color:black'>mmin  + <span style='color:#FF8000'>30 <span style='color:navy'>- </b> exec <span style='color:#0080FF'>rm <span style='color:navy'>{} </b> \ <span style='color:navy'>; </b>

Configuring the ClickTale.yml File
The clicktale.yml file (in app_root/config ) contains default values for each of the required properties.

Usage with Load Balancers and Reverse Proxies
Most integration modules default to using local storage (often in process memory) for storing the temporary cache of pageviews content. This content is later requested by ClickTale servers via HTTP(S). When using more than one server together with a load balancer to distribute the requests across the servers, it is possible that a visitor may be forwarded to a different server than the one which the ClickTale Bot is forwarded to. As a result, the Bot arrives at a server that doesn't contain the requested information and the recording (not the response to the visitor) fails with a 404 error. A proper load balancing configuration should implement one of the following:
 * 1) A way to force the request from ClickTale to reach a specific server in the farm
 * 2) A cache store that is centralized

Validating Integration Functionality
To validate the integration functionality:
 * Check that files are being written to the cache.
 * Check that the recording files in your ClickTale account are displaying properly.