Difference between revisions of "ConversionRuler Tracking Snippets"

From Market Ruler Help
Jump to: navigation, search
m
m
Line 32: Line 32:
 
'''Tracking Queue:'''
 
'''Tracking Queue:'''
 
<code>var _crq = window._crq || [];<br />
 
<code>var _crq = window._crq || [];<br />
_crq.push(['clicked-button', '', 'Blue Button']);<br />
+
<nowiki>_crq.push(['clicked-button', '', 'Blue Button']);</nowiki><br />
 
</code>
 
</code>
  
 
'''cr_track:'''
 
'''cr_track:'''
<code>cr_track('clicked-button', '', 'Blue Button');
+
<code><nowiki>cr_track('clicked-button', '', 'Blue Button');</nowiki>
 
</code>
 
</code>

Revision as of 13:50, 18 April 2013

ConversionRuler Tracking Snippets are a mix of JavaScript code and HTML code which allows ConversionRuler to track actions of visitors to your site.

The basic layout of the tracking snippet is:

  1. Script which loads ConversionRuler JavaScript code for each page
  2. Script which records a landing or an action on a page
  3. HTML which records a landing or an action in browsers which do not support JavaScript

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:

http://www.conversionruler.com/bin/js.php?siteid=Site ID

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:

Passing values can be performed by passing values to the Tracking Queue or the cr_track function, like so:

Tracking Queue: var _crq = window._crq || [];
_crq.push(['clicked-button', '', 'Blue Button']);

cr_track: cr_track('clicked-button', '', 'Blue Button');