Tracking Landings and Actions (JavaScript)

From Market Ruler Help
Revision as of 19:06, 30 June 2016 by Admin (talk | contribs)
Jump to: navigation, search

The __CR.track call in ConversionRuler is the primary function which records all of the information about the current page being viewed and sends it to our Web Servers.

Recording values with your Conversion Actions

You can pass up to four text values and four amounts to ConversionRuler to be stored along with the action that a visitor has taken.

The text values are for recording order numbers, email addresses, or anything you want to store about a particular visitor or action.

The amounts are for recording order amounts, taxes, shipping charges, or anything you want to store and view in total for a particular visitor or action.

To do so, specify the values you wish to record as global variables prior to invoking ConversionRuler's __CR.track function:

var cramount0 = '$452.22';
var crtext0 = 'ORDER5124125123123';
var crtext1 = 'john@example.com';
__CR.track(3);

The syntax of this function is:

__CR.track(action_code)

Note that the first parameter is optional, but unless an action code is specified, the amount and text values will be ignored.

Recorded values

The following global variables are available to record order amounts or order numbers, or any other information related to the action being recorded:

  • cramount or cramount0
  • cramount1
  • cramount2
  • cramount3
  • crtext or crtext0
  • crtext1
  • crtext2
  • crtext3

Note that cramount and cramount0 are synonyms. If, for some reason, both are specified, then the value for cramount is recorded, and cramount0 is ignored.

Likewise, crtext will be recorded, and crtext0 will be ignored if both are specified on the page.

Very important: Landings do not record amounts or text. To record the amount0...3 and the text0...3 values, you must specify an Action Code in the __CR.track call.

See also

Deprecated Functionality: Passing values in the __CR.track call

Because passing 9 variables to a function is error prone, this means of recording action data is deprecated.

The syntax of this function is:

__CR.track(action_code, amount0, text0, amount1, text1, amount2, text2, amount3, text3)

Note that all parameters are optional.

  • action_code - To record landings, specify an empty string '' or the number zero ("0"). Otherwise, this is the Action Code which corresponds to the Conversion Action you'd like to record.
  • amount0, amount1, etc. - To record order amounts, subtotals, or any numeric information which will be summed up in reports, specify amounts in the positions above.
  • text0, text1, etc. - To record any string to be associated

Deprecated Functionality: cr_track

The __CR.track function was previously called cr_track and has since been renamed. The cr_track call will be supported until its use is no longer detected.

Deprecated Functionality: tlitrack

The __CR.track function was previously called tlitrack and has since been renamed. The tlitrack call will be supported until its use is no longer detected.

See also