On this oage:


Overview

This guide explains how to complete your integration with Shopify by inserting some JavaScript on your shop's website in order to enable Ometria to receive interaction data.

The steps below contain instructions for both Shopify and Shopify Plus


Note: If you have multiple stores in one account (e.g. UK, France, Germany) you'll need to request the namespace for each store. Contact your technical project manager or support@ometria.com  


You will have received an account setup link from Ometria detailing your integration steps. 

Step 2 in this link contains some JavaScript tracking code, which you should copy before beginning the steps below. 

Once you've copied the JavaScript code, log into your store's administration panel and select Themes

Choose a live theme and select Template Editor.


Setup steps

1. Locate the list of files (templates) in the left panel and select theme.liquid

The contents for this template display on the right:

2. Next, paste your copied code between the </body> and </html> tags at the bottom of the page:

If you have multiple stores in one account (e.g. UK, France, Germany) and requested the namespace for each store from Ometria, you need to paste a comma ( , ) after customer_email:{{customer.email|json}} followed by the namespace you were provided (e.g. namespace:"uk:").

Example:



If...then...

you are a Shopify user 

continue to step 3.

you are a Shopify Plus user

navigate to checkout.liquid and paste the same code between the </body> and </html> tags at the bottom of the page, then continue to step 3

3. Click Save


Note: You'll need to repeat steps 1 and for all published themes.


4. Click Settings from the bottom of the navigation panel on the left, then click on Checkout:

Scroll down until you see the Additional Scripts box and paste the following code into the box: 

<script>if (typeof ometria == 'undefined') window.ometria = {};
ometria.raw_data={template:'confirmation',order:{{order.id|json}},customer_email:{{customer.email|json}}};</script>
<script>
(function(){
var url=window.location.protocol+"//cdn.ometria.com/tags/<your_site_identifier.js>";
setTimeout(function(){var sc=document.createElement('script');sc.src=url;sc.setAttribute('async','true');
document.getElementsByTagName("head")[0].appendChild(sc);},50);
})();
</script>



Note: Replace <your_site_identifier.js> with the site identifier supplied by Ometria.


5. Select Save .

What’s next?

Now you’ve setup your integration, you can set up your subscription webhook.