Introduction


This guide illustrates how to complete the integration with Shopify by inserting a bit of code on your shop's website (in order to enable Ometria to receive interaction data).


Steps to Implement


1. Log in to your store's administration panel, click on Themes, and then on Template Editor on a published theme. 


Note, you'll need to repeat steps 1, 2 and 3 for all published themes.

2. A list of files (templates) is shown on the left, the top one called theme.liquid. Please click on this file, which will display its contents on the right-hand side.


Fig 2: themes.liquid page


3. Paste the code as provided during the integration between the </body> and </html> tags at the bottom of the page.


</body>
</html>


Press the Save button.


Note, you'll need to repeat steps 1, 2 and 3 for all published themes.


4. Now click on Settings (see Fig 3) from the bottom of the navigation panel on the left, then click on Checkout


Please scroll down until you see the Additional Scripts box as shown on the screenshot (fig 4) below and paste the following code into the box, then press the Save button.

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


<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>


Fig 3: Settings


Fig 4: Additional Scripts