Named Actions

From Market Ruler Help
Revision as of 03:47, 15 February 2013 by Admin (talk | contribs)
Jump to: navigation, search

As of February 2013, you can use action names instead of numbers for your actions in ConversionRuler. The usage is almost identical in ConversionRuler, except that you must pass action codes in quotes when passed to ConversionRuler. It simply makes it easier to associate the actions with their meaning in the JavaScript code.

So, for example:

<script type="text/javascript">
   cr_track('order', '$129.99', '#571298120');
</script>

Is far simpler to understand than:

<script type="text/javascript">
   cr_track('3', '$129.99', '#571298120');
</script>

You must quote actions passed to cr_track (unless you are actually passing a variable - for advanced JavaScript marketers.), so,

<script type="text/javascript">
   // ERROR DO NOT DO THIS
   cr_track(order, '$129.99', '#571298120');
</script>

will produce an error and will not track.

Action names:

  • Do not have to match by case to track correctly (so, "Order", "order", and "oRdEr" are considered identical)
  • Can have spaces in them, but not at the beginning or end
  • Should avoid using quotes, although technically they are allowed (so, "they're leaving" is valid, although we suggest avoiding it for JavaScript syntax errors.)

The named actions functionality was rolled out simultaneously with the Tracking Queue functionality for AJAX applications. So, an alternate way to use named actions is:

<script type="text/javascript">
   _crq.push(['order', '$129.99', '#571298120']);
</script>