Difference between revisions of "Tracking Landings and Actions (JavaScript)"

From Market Ruler Help
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
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 Server]]s.
+
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 Server]]s.
  
 
== Recording values with your [[Conversion Action]]s ==
 
== Recording values with your [[Conversion Action]]s ==
Line 8: Line 8:
 
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.
 
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:
+
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 cramount0 = '$452.22';
 
  var crtext0 = 'ORDER5124125123123';
 
  var crtext0 = 'ORDER5124125123123';
 
  var crtext1 = 'john@example.com';
 
  var crtext1 = 'john@example.com';
  cr_track(3);
+
  __CR.track(3);
  
 
The syntax of this function is:
 
The syntax of this function is:
  
  cr_track(''action_code'')
+
  __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.
 
Note that the first parameter is ''optional'', but unless an action code is specified, the amount and text values will be ignored.
Line 38: Line 38:
 
Likewise, '''crtext''' will be recorded, and '''crtext0''' will be ignored if both are specified on the page.
 
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 amount''0...3'' and the text''0...3'' values, you must specify an [[Action Code]] in the '''cr_track''' call.
+
'''Very important:''' Landings '''do not record amounts or text'''. To record the amount''0...3'' and the text''0...3'' values, you must specify an [[Action Code]] in the '''__CR.track''' call.
 
== See also ==
 
== See also ==
 
* [[:Category:ConversionRuler JavaScript Functions|ConversionRuler JavaScript Functions]]
 
* [[:Category:ConversionRuler JavaScript Functions|ConversionRuler JavaScript Functions]]
 
* [[Tracking Order Amounts]]
 
* [[Tracking Order Amounts]]
  
== Deprecated Functionality: Passing values in the cr_track call ==
+
== 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]].''
 
''Because passing 9 variables to a function is error prone, this means of recording action data is [[deprecated]].''
  
 
The syntax of this function is:
 
The syntax of this function is:
  
  cr_track(''action_code'', ''amount0'', ''text0'', ''amount1'', ''text1'', ''amount2'', ''text2'', ''amount3'', ''text3'')
+
  __CR.track(''action_code'', ''amount0'', ''text0'', ''amount1'', ''text1'', ''amount2'', ''text2'', ''amount3'', ''text3'')
  
 
Note that all parameters are ''optional''.
 
Note that all parameters are ''optional''.
Line 55: Line 55:
 
* ''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.
 
* ''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
 
* ''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 ==
 
== Deprecated Functionality: tlitrack ==
The '''cr_track''' function was previously called '''tlitrack''' and has since been renamed. The '''tlitrack''' call will be supported forever.
+
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 ===
+
== See also ==
 
* [http://conversion.marketruler.com/setup/codegen.php ConversionRuler Code Generator]
 
* [http://conversion.marketruler.com/setup/codegen.php ConversionRuler Code Generator]
 
* [[JavaScript]]
 
* [[JavaScript]]
 
* [[JavaScript onclick]]
 
* [[JavaScript onclick]]
 
* [[Tracking Links (JavaScript)]]
 
* [[Tracking Links (JavaScript)]]
* [[cr_submit|cr_submit]]
+
* [[__CR.submit|__CR.submit]]
* [[cr_link|cr_link]]
+
* [[__CR.link|__CR.link]]
* [[When to use cr_submit, cr_link, and cr_track]]
+
* [[When to use __CR.submit, __CR.link, and __CR.track]]
  
 
[[Category:ConversionRuler]]
 
[[Category:ConversionRuler]]
Line 72: Line 75:
 
[[Category:ConversionRuler JavaScript Functions]]
 
[[Category:ConversionRuler JavaScript Functions]]
 
[[Category:ConversionRuler Installation]]
 
[[Category:ConversionRuler Installation]]
 +
[[Category:2023 Needs Update]]

Latest revision as of 21:16, 10 December 2023

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