Difference between revisions of "When do I use different JavaScript tracking methods?"

From Market Ruler Help
Jump to: navigation, search
(Created page with 'ConversionRuler offers three ways of tracking actions using JavaScript on your web site, they are: * cr_track - For tracking landings and actions on page loads * [[…')
 
Line 15: Line 15:
 
The issue is that for binary content, the page loads to a new URL and some browsers do not call our tracking code at all before the new content loads.
 
The issue is that for binary content, the page loads to a new URL and some browsers do not call our tracking code at all before the new content loads.
  
As a general rule, '''if a link or form opens a new window, or performs an [[AJAX]] call''', you can use [[cr_track|cr_track]].  
+
 
 +
 
 +
As a general rule, '''if a link or form opens a new window, or performs an [[AJAX]] call''', you can use [[cr_track|cr_track]] instead of [[cr_link|cr_link]] or [[cr_submit|cr_submit]].
 +
 
 +
When in doubt
  
 
==When to use cr_link==
 
==When to use cr_link==
Line 21: Line 25:
 
[[cr_link|cr_link]] was added in order to solve a particular bug in browsers when downloading binary files, like installers, PDFs or executables.
 
[[cr_link|cr_link]] was added in order to solve a particular bug in browsers when downloading binary files, like installers, PDFs or executables.
  
[[cr_link|cr_link]] works by:
+
When a user clicks on a link which is [[cr_link|cr_link]]-enabled, it:
  
# Tracking the action with ConversionRuler ...
+
# Tracks the action with ConversionRuler ...
# Delaying 300 microsectods
+
# Waits 300 microsectods
# Following the link
+
# Follows the link
  
This solves the bug in all browsers. (The bug was present at the time in FireFox and Safari.)
+
This solves the bug in all browsers. (The bug is present in FireFox and Safari.)
  
 
In prior versions of the tracking, you could use [[cr_track|cr_track]]:
 
In prior versions of the tracking, you could use [[cr_track|cr_track]]:
  
  <a href="/page.html" onclick="return cr_track(2)">Track link</a>
+
  <a href="/page.html" onclick="return cr_track(2)">Track link with action 2</a>
  <a href="/page.html" onclick="return cr_link(this, 2)">Track link</a>
+
 
 +
or
 +
 
 +
  <a href="/page.html" onclick="return cr_link(this, 2)">Track link with action 2</a>
  
 
Both tracking forms are still acceptable, but it is generally recommended to use [[cr_link|cr_link]] as it handles all cases accurately for all kinds of links.
 
Both tracking forms are still acceptable, but it is generally recommended to use [[cr_link|cr_link]] as it handles all cases accurately for all kinds of links.
 +
 +
==When to use cr_submit==
 +
 +
[[cr_submit|cr_submit]] was added in order to solve a bug in browsers when submitting a form which results in a binary file download (such as installers, PDFs or executables.)
 +
 +
It works similarly to how [[

Revision as of 02:11, 19 July 2011

ConversionRuler offers three ways of tracking actions using JavaScript on your web site, they are:

  • cr_track - For tracking landings and actions on page loads
  • cr_link - For tracking when visitors click on links
  • cr_submit - For tracking form submissions

Why different forms of tracking?

cr_link and cr_submit were added solve some specific issues with certain browsers and downloading non-web content (like installers, PDFs and other binary content).

The issue was, unfortunately, that tracking wouldn't work due to issues with those browsers.

What's the problem?

The issue is that for binary content, the page loads to a new URL and some browsers do not call our tracking code at all before the new content loads.


As a general rule, if a link or form opens a new window, or performs an AJAX call, you can use cr_track instead of cr_link or cr_submit.

When in doubt

When to use cr_link

cr_link was added in order to solve a particular bug in browsers when downloading binary files, like installers, PDFs or executables.

When a user clicks on a link which is cr_link-enabled, it:

  1. Tracks the action with ConversionRuler ...
  2. Waits 300 microsectods
  3. Follows the link

This solves the bug in all browsers. (The bug is present in FireFox and Safari.)

In prior versions of the tracking, you could use cr_track:

<a href="/page.html" onclick="return cr_track(2)">Track link with action 2</a>

or

<a href="/page.html" onclick="return cr_link(this, 2)">Track link with action 2</a>

Both tracking forms are still acceptable, but it is generally recommended to use cr_link as it handles all cases accurately for all kinds of links.

When to use cr_submit

cr_submit was added in order to solve a bug in browsers when submitting a form which results in a binary file download (such as installers, PDFs or executables.)

It works similarly to how [[