Shopify Integration Guide

This guide is for integrating Shopify with AvantLink. This integration is usually easy!

Step 1 - Install the site wide script

Keep in mind: any theme changes have the potential to overwrite our site-wide script. If you need to make a theme change, you can go through this guide again at any point.

From your Shopify admin, go to Online Store > Themes > Actions > Edit Code.

Replace "1111111" with your site ID and paste the following AvantLink code in your theme.liquid file, just before the closing </body> tag. ** Depending on your theme, this code may need to be placed elsewhere. Please reach out to integration@avantlink.com if you have questions about this.

<!-- AvantLink Sitewide script -->
<script type="text/javascript">
(function() {
var avm = document.createElement('script'); avm.type = 'text/javascript'; avm.async = true;
avm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.avmws.com/1111111/';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(avm, s);
})();
</script>

Step 2 - Install the order confirmation script

From your Shopify admin, go to Settings > Checkout > Order Processing.

Again, replace "1111111" with your site ID and paste the following AvantLink order confirmation code in the "Additional Scripts" section.

<!-- AvantLink Order Confirmation script-->
<script type="text/javascript">
var _AvantMetrics = _AvantMetrics || [];
_AvantMetrics.push(['order',{ order_id:'{{order_number}}', amount:'{{subtotal_price | money_without_currency}}', state:'{{billing_address.province_code}}', country:'{{billing_address.country_code}}' }]);
{% for line in line_items %}
_AvantMetrics.push(['item',{ order_id:'{{order_number}}', variant_sku:'{{line.product.id}}', price:'{{line.price | money_without_currency}}', qty:'{{line.quantity}}' }]);
{% endfor %}
</script>

<!-- AvantLink Sitewide script -->
<script type="text/javascript">
(function() {
var avm = document.createElement('script'); avm.type = 'text/javascript'; avm.async = true;
avm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.avmws.com/1111111/';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(avm, s);
})();
</script>

Step 3 - Set up an API credentials for your product feed.

Shopify Product Datafeed Integration - please see here for instructions

We typically require a product datafeed. Setting up a product datafeed is easy with Shopify. This enables affiliates to use many tools which give them an advantage with their specific sites (e.g. a review site who displays the live pricing by fetching this product into the review). This updates for your affiliates every 24 hours.

Step 4 - Integration Tests

Testing your Integration - Please see here for instructions

After everything is set up, we must do a full tracking test. You can test at any point in the future. If you have any questions about the test process, please reach out to integration@avantlink.com.

Have more questions? Submit a request