Difference between revisions of "Tracking Queue"
(Created page with 'ConversionRuler allows you to track events on your page which likely occur in a "Web Application" where the page URL is never reloaded, but content is loaded dynamically usin…') |
|||
Line 19: | Line 19: | ||
Typically, this will be placed deep within your JavaScript application code. Note: | Typically, this will be placed deep within your JavaScript application code. Note: | ||
− | * | + | * '''The queue must be created within the global window scope''' |
− | * | + | * '''The queue must be an array''' |
You can pass parameters to the queue as well, in which case you will pass an array to the queue, as follows: | You can pass parameters to the queue as well, in which case you will pass an array to the queue, as follows: | ||
Line 33: | Line 33: | ||
[[Category:ConversionRuler Features]] | [[Category:ConversionRuler Features]] | ||
[[Category:ConversionRuler Tracking]] | [[Category:ConversionRuler Tracking]] | ||
+ | [[Category:ConversionRuler JavaScript Functions]] |
Revision as of 03:31, 15 February 2013
ConversionRuler allows you to track events on your page which likely occur in a "Web Application" where the page URL is never reloaded, but content is loaded dynamically using AJAX and JavaScript. Many new applications, particularly for Mobile Devices, are written using this type of functionality, and so it makes sense to be able to easily communicate these to ConversionRuler with the minimum overhead required.
Note that this method should only be used when conversions do not reload the current page. The easiest way to determine this is if the page address stays the same (although this is not always the case.)
Data is communicated to ConversionRuler using an event queue which takes similar parameters to cr_track.
To use the queue, you must initialize it to an empty array using the following code:
<script type="text/javascript"> var _crq = window._crw || []; </script>
Simple enough. To send an event to ConversionRuler, you simply push an event on the end of the queue, as follows:
<script type="text/javascript"> _crq.push('clicked-button'); </script>
Typically, this will be placed deep within your JavaScript application code. Note:
- The queue must be created within the global window scope
- The queue must be an array
You can pass parameters to the queue as well, in which case you will pass an array to the queue, as follows:
<script type="text/javascript"> _crq.push(['orders', '$29.99', '#51209035']); </script>
The main difference is the passing of an array.