Shopify LiveConnect Implementation

The LiveConnect Tag is a web tag that powers LiveIntent’s People Based Marketing solutions. The intent captured onsite enhances campaign performance, conversion tracking and audience segmentation. Below are instructions on how to implement the LiveIntent Tag on your Shopify store. 

💡 Please Note: For any conversion events other than product purchase, please reach out to your LiveIntent account team. 

 

LiveConnect Base Tag 

  1. Under Sales Channels, select "Themes"
  2. Under Themes, select the "Layout" folder
  3. Within the Layout folder, select theme.liquid
  4. Place the base LiveConnect tag into the head of the theme.liquid layout 

Please note: your LiveIntent account team will provide you with a LiveConnect tag containing your specific ID. Below is an example of what it could look like:

<script type="text/javascript" src="//b-code.liadm.com/a-00xx.min.js" async="true" charset="utf-8"></script>

 

Event: Product Purchase Conversion 

  1. From your Shopify admin, go to Settings > Checkout.
  2. In the Order processing section, find the additional scripts text box:

AdditionScript_screenshot.jpg

3. Paste the same LiveConnect base tag into this box.

4. Paste your tracking code from your clipboard with cmd + v on a Mac or ctrl + v on a PC.

In that text box, you are able to use the shop Liquid object, the order Liquid object, and the OrderStatus JavaScript asset.

{% if first_time_accessed %}
<!-- LiveConnect Conversion Extension Script -->
<script type="text/javascript">
window.liQ = window.liQ || [];
window.liQ.push(
{"event": "conversion",
"name":"product_purchase",
"email": "{{ checkout.email }}",
"conversionId": "{{ order_number }}",
"amount":"{{ checkout.total_price | money_without_currency }}",
"currency": "{{ shop.currency }}",
"items": [{% for line_item in checkout.line_items %}{
"id": "{{ line_item.variant_id }}",
"price":"{{ line_item.price | money_without_currency }}",
"quantity":"{{ line_item.quantity }}"}
{% unless forloop.last %},{% endunless %}
{% endfor %}]});
</script>
{% endif %}

To prevent your analytics from counting the same customers more than once, we've added the first_time_accessed property around this script. With the first_time_accessed code in place, Shopify will run this script only the first time your customers see their order thank you and status page.

 

Event: Product View (optional)

Your LiveIntent account team will advise on whether or not you need to place product view events.

  1. Under Sales Channels, select "Themes"
  2. Under Themes, select the “Sections” folder
  3. Within the Section folder, select product.liquid

Copy and paste the following into the product.liquid section 

  <script> 
    window.liQ = window.liQ || [];
    window.liQ.push
        ({
          event: "viewContent",
          email: "{{ customer.email }}",
          contentType: "Product",
          name: "{{ product.type }}",
          contentId: "{{ current_variant.sku }}"
        });
  </script>

 

Additional Resources  

For more in-depth details, visit these Shopify documents: 


Have more questions? Submit a request