All Collections
Integrations
Shopify integration
Integrating with Shopify: JS-code-based method (aka Old method)
Integrating with Shopify: JS-code-based method (aka Old method)
Maria avatar
Written by Maria
Updated over a week ago

Note: This guide only covers Shopify Online Store. Other sales channels such as “Buy Button” and ReCharge are not supported.

  1. In your shop’s admin environment, please go to: Sales Channels > Online Store > Themes > Click on actions > Edit Code

  2. Select the theme.liquid file in the layouts folder. Add the following code, just before the </head> tag.

    <script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script> <script type="text/javascript"> (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap'); tap('create', 'YOUR ACCOUNT ID', { integration: "shopify" }); tap('detect'); </script>

    Make sure to replace YOUR ACCOUNT ID with your actual account id.

  3. Hit save

  4. Next, in your shops admin environment, go to: Settings > Checkout > Scroll down to the option Order processing and keep scrolling until you see the box Additional scripts


    In the additional scripts section, locate the Order Status Page block, and paste in the following code:

    {% if first_time_accessed %} <script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script> <script type="text/javascript"> (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){ (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap'); tap('create', 'YOUR ACCOUNT ID', { integration: "shopify" }); tap('conversion', '{{ order_number }}', {{ order.subtotal_price }}/100, { coupons: {{ order.discounts | map: 'code' | json }}, currency: "{{ order.currency }}", customer_id: "{{ order.email }}", }); </script> {% endif %}

    Make sure to replace YOUR ACCOUNT ID with your actual account id.

  5. Hit save and you are all done!

Important

Please remember to test a conversion before starting your program. This way you can verify that tracking has been set up correctly. You can create a test conversion by following the steps described here.

Did this answer your question?