Difference between revisions of "Conversion Tracking"

From Spiffy Stores Knowledge Base

Line 41: Line 41:
 
==== Example AdWords Conversion Tracking ====
 
==== Example AdWords Conversion Tracking ====
  
When adding the tracking code for AdWords, you just need to chnage one small part of the tracking code that AdWords provides you with, by adding in your order amount with the "total_price" tag as displayed below.
+
When adding the tracking code for AdWords, you just need to change one small part of the tracking code that AdWords provides you with, by adding in your order amount with the "total_price" tag as displayed below.
  
 
Add in the tag <pre>{{ total_price | money }}</pre> in two places as displayed below in our example.
 
Add in the tag <pre>{{ total_price | money }}</pre> in two places as displayed below in our example.

Revision as of 12:14, 31 July 2012

Conversion Tracking describes the practice of integrating "web bugs" into the checkout process which report back to a centralised third-party server when products are sold. This is commonly also described as a tracking pixel.

Tracking orders

Tracking pixels can be integrated in the Preferences -> Checkout & payment -> Additional Content & Scripts section of your store's Toolbox.

You are able to access the shop variable and you will find all the order variables which are customarily available to order notification emails.

Example

Your tracking system asks you to integrate a tracking pixel like this:

<img src="https://www.tracking.com/pixel.gif?amount=<AMOUNT>&order-id=<ORDER ID>&currency=<CURRENCY>" height="1" width="1"/>

Looking at the above example we know that we need:

  • full money amount of order. Probably in dollars :
    {{ total_price | money }}
  • A unique order id. order_name will print out the name of the order such as #02322 which will suit our purposes:
    {{order_name}}
  • A unique order number. order_number will print out the order number without formatting such as 02322:
    {{order_number}}
  • Our shop's currency. We can either hard code this or use
    {{shop.currency}} 

Let's replace the examples with actual liquid code:

<img src="https://www.tracking.com/pixel.gif?amount={{total_price | money}}&order-id={{order_name}}&currency={{shop.currency}}" height="1" width="1"/>

When a customer reaches the last page of the checkout the code that will actually be delivered to his browser will then look something like this:

<img src="https://www.tracking.com/pixel.gif?amount=55.34&order-id=#02322&currency=AUD" height="1" width="1"/>



Example AdWords Conversion Tracking

When adding the tracking code for AdWords, you just need to change one small part of the tracking code that AdWords provides you with, by adding in your order amount with the "total_price" tag as displayed below.

Add in the tag

{{ total_price | money }}

in two places as displayed below in our example.

<!-- Google Code for SALES Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 123456;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "ttX7COr-gFFFtkPGsgL";
var google_conversion_value = {{ total_price | money }};
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/123456/?value={{ total_price | money }}&label=ttX7COr-gFFFtkPGsgL&guid=ON&script=0"/>
</div>
</noscript>

You will need to ensure that you ONLY use the code that Google provides you with. DO NOT copy and paste our example.