Installing Webtrends Optimize into a Shopify store

This document describes how to install Webtrends Optimize into a regular Shopify store (i.e. not Plus).

While we don't yet have a plugin, installation should only take 2-3 minutes with these details to hand. Please also note - if you're not on Shopify Plus, you can only install Webtrends Optimize outside of the checkout funnel. Only Shopify Plus supports inserting code into the checkout.

Get your tag from the Webtrends Optimize UI

1. Enter the Tagging Guide from the top nav:

2. Copy the tag script

Login to your Shopify Admin area

You should know how to do this. Typically accessed through

Find the liquid template

Paste in the Webtrends Optimize tag

This should already be in your clipboard. Paste it into the area shown below.

1. Find and click on theme.liquid

2. Paste in the code from your clipboard before the close head tag

3. Hit the Save button.

Tracking Purchases, Revenue, Units etc.

Shopify does not use the theme.liquid file on the thank-you page, so you will need to implement this manually. Doing so is fairly easy.

1. Go to Settings > Checkout and accounts

2. Scroll down to Order Status, and you'll find a big text field.

Paste in the following code:

window.opt_data = window.opt_data || [];
    event: "Purchase",
    data: {
        orderid: "{{ order_number }}",
        revenue: {{ total_price | money_without_currency }},
        units: {{ order.item_count }}
var sc = document.createElement('script');
sc.src = "//";

NOTE: Please replace YORU_GUID_HERE with the guid from the tag script you copied earlier. e.g. 39fc2ef3-0e93-428c-a87d-c0072d3329c5

Once pasted, save and close.

In Optimize, we now need to specify the Custom Data fields you capture. Doing so will attach the custom data to every new project you create automatically, so no need for 1-off efforts.

This is something your technical support team will need to set up for you. It only takes a minute - please ask us to handle this. Once complete, the Automated Tracking screen will list all of your fields.