Help Documentation

Conversion Tracking on Shopify

Updated on

Setting up Conversion Tracking with Shopify

If you have a store on Shopify, you can add the iPost web tracking script in order to send conversion data back to iPost and display it in the platform. Follow the steps below to set up conversion tracking.

  1. Go to the Web Tracking page under the General Settings menu.
  2. Click on the Add New Website button.
  3. In Website Name, insert the URL of your Shopify Store, i.e. “myshopifystore.com”.
  4. Click Save.
  5. Click Publish.
  6. After this, a JavaScript code will appear in the Script Loader box.
  7. Copy this code.

Shopify Configuration

  1. Log into your Shopify admin account.
  2. Go to the Themes page and select Edit code to edit the theme currently being used:

3.    Click on each layout element to open and edit it:

4.    In each of these pages, insert the “Script Loader” JavaScript code right before the end of </body> closing HTML tag.

5.    After saving the pages, go to Settings:

6.    Click on Checkout:

7.    In the Order processing section and in the text box under Additional scripts, insert the “Script Loader” JavaScript code.

8.    After inserting the code above, insert the code displayed below in the same box:

<script>
var today = new Date();
var orderObj = {
    conversion: {
               ConversionPage: 'thankyou',
               ConversionType: 'order',
               OrderID: '{{ order.order_number }}',
               OrderGrandTotal: '{{ order.total_price | money_without_currency  }}',
               OrderDate: today,
               OrderSource: '',
               OrderStoreId: '{{ shop.name }}',
               OrderSubTotal: '{{ order.subtotal_price | money_without_currency  }}',
               OrderTax: '{{ order.tax_price | money_without_currency  }}',
               orderShipping: '{{ order.shipping_price | money_without_currency  }}',
               CouponUsed: '{% if order.discounts %}true{% endif %}',
               OnSale: '',
               OrderDomain: '',
               Items: [
                              {% for item in order.line_items %}
                              {
                                             Title: '{{ item.title }}',
                                             Sku: '{{ item.sku }}',
                                             Price: '{{ item.price | money_without_currency  }}',
                                             Quantity: '{{ item.quantity }}'
                              },
                              {% endfor %}
               ]
   }
}
window.onload = function(e){
   window.iPostAnalytic.send(orderObj);
 };
</script>
Click to copy

9.    Save the edits on this page

You are now set and can start sending emails. Be sure to remember to enable Web Tracking in the send configuration.

Please contact iPost Support if you wish to have additional data sent to iPost.

Previous Article Conversion Tracking
Next Article Funnels