ConversionRuler Tracking Snippets
The basic layout of the tracking snippet is:
- Script which records a landing or an action on a page
Each component of the Tracking Snippet can be implemented separately for a website which wishes to implement ConversionRuler tracking in a more modular way.
Script which loads ConveresionRuler
This script is written in such a way that it loads ConversionRuler tracking code based on whether the current page is a http:// or https:// page (Secure or non-Secure). It loads the script from ConversionRuler's servers:
This script is dynamically generated and is based on the features selected for the Site ID passed through. In addition, this script can take the following additional query string parameters:
- nocache - Integer value which changes how the script returns caching headers. Adding nocache=1 to the script loading API will set caching headers such that the script is loaded upon every page load.
- crcookie - Force the use of a particular cookie for tracking. If a site wishes to use first-party cookies, they can pass the desired cookie to ConversionRuler for recording. The cookie should be a 32-character hexadecimal string containing only the numbers 0 through 9 and A through F, e.g. 324d8a1d3f81e730d5099a48cee0c5b6
Script which records a landing or an action on a page
At present, there are two different methods to record a landing and/or action:
var _crq = window._crq || ;
_crq.push(['clicked-button', '', 'Blue Button']);
__CR.track('clicked-button', '', 'Blue Button');
var crtext0 = "automatically saved when tracking records";
It calls into a different script on ConversionRuler servers:
http://www.conversionruler.com/bin/tracker.php?siteid=Site ID&actn=Action Name&crcookie=User Identifier&...
This tracking script takes the following parameters:
- siteid - The Site identifier.
- actn - An action, if any, to record. Can be an arbitrary string but must be configured server-side to record correctly. Specifying no action indicates the action recorded as a landing.
- crcookie - The user identifier. 32-character hexadecimal string. (See description above)
- v - Snippet version number. Number indicating what version of the snippet is recorded.
- refb - Current page URL.
- referer - Page referrer.
- tu - Top URL (for Frame-based sites)
- same - Force recording of landings from the same domain name (can be set server-side for a site as well)
- Action Variables - Pass cramount[0-4] or crtext[0-4] as part of the tracking URL to record values for an action (requires an action to be passed as well)
Within each URL, including the main URL for the tracking (above) you can pass Landing Parameters as part of the:
- Tracking URL (the tracker.php URL)
- Page URL
- Referrer URL
- Top Page URL
ConversionRuler will extract the landing page parameters from the above URLs, in order, until it finds a valid landing.