Affiliate Marketing

Integrating Affiliate Tracking with Shopify: A Step-by-Step Guide

10 February 2026 8 min read

Shopify powers millions of e-commerce stores worldwide, and integrating affiliate tracking is one of the most impactful steps you can take to grow your partnership channel. But getting the integration right — with accurate conversion tracking, proper deduplication, and reliable server-side backup — requires more than just dropping a pixel on your thank-you page.

This step-by-step guide covers how to integrate AWIN, Impact, and CJ affiliate tracking with your Shopify store, including common pitfalls and best practices for 2026.

Understanding Shopify's Tracking Architecture

Before integrating any affiliate network, understand how Shopify handles conversion tracking:

Checkout Pages

Shopify's checkout is hosted on a separate subdomain (checkout.shopify.com). This means tracking scripts placed in your theme's standard pages don't fire during checkout. You need to add conversion pixels through Shopify's dedicated "Additional scripts" section or through Shopify's newer Web Pixels API.

Thank-You Page

The order confirmation (thank-you) page is where conversion pixels typically fire. Shopify provides access to order data through Liquid template variables that can be passed to your affiliate network's pixel.

Cookie Restrictions

Because Shopify's checkout runs on a different domain, first-party cookies set on your main domain may not be accessible during checkout. This makes server-side tracking particularly important for Shopify stores.

AWIN Integration with Shopify

Step 1: Install the MasterTag

Add AWIN's MasterTag to your Shopify theme. Navigate to Online Store → Themes → Actions → Edit Code → theme.liquid. Place the MasterTag script just before the closing </head> tag:

The MasterTag handles click tracking, cookie placement, and consent management across your entire storefront. Ensure it fires on every page, including collection pages and product pages.

Step 2: Add the Conversion Pixel

In your Shopify admin, go to Settings → Checkout → Additional Scripts (or for newer stores, Customer Events). Add AWIN's conversion tracking code that fires on the order status page.

Your pixel should pass these Shopify Liquid variables to AWIN:

  • Order ID: {{ order.order_number }}
  • Sale amount: {{ checkout.subtotal_price | money_without_currency }} (excluding shipping and tax)
  • Currency: {{ shop.currency }}
  • Voucher code: {{ order.discount_codes | map: 'code' | join: '|' }}
  • Product data: Loop through {{ checkout.line_items }} for product-level tracking
Pro Tip: Always pass the subtotal (excluding shipping and tax) as your sale amount, not the total order value. Commission calculated on inflated order values will eat into your margins unnecessarily. Configure this in both your pixel and your AWIN commission settings to ensure consistency.

Step 3: Implement Server-Side Tracking

For Shopify stores, server-side tracking is particularly critical because of the cross-domain checkout architecture. AWIN offers several S2S integration methods:

  • Shopify Webhooks: Configure an order creation webhook in Shopify that sends transaction data to AWIN's server-side endpoint. This fires independently of any browser-based tracking.
  • AWIN Shopify App: AWIN offers a Shopify app that simplifies both pixel and server-side integration. This is the fastest setup method for most stores.
  • Custom API integration: For stores with bespoke requirements, AWIN's advertiser API allows direct server-to-server conversion posting.

Step 4: Test Thoroughly

Testing AWIN tracking on Shopify requires specific attention:

  • Click an AWIN test link and complete a test purchase
  • Verify the conversion appears in AWIN's reporting with correct order value
  • Check that product-level data is passed accurately
  • Test with a discount code applied to verify voucher tracking
  • Test on Safari (which has the strictest cookie policies)
  • Verify server-side tracking fires independently by blocking JavaScript in your browser and completing a test purchase

Impact Integration with Shopify

Universal Tracking Tag

Impact's Universal Tracking Tag (UTT) serves a similar function to AWIN's MasterTag. Add it to your theme.liquid file in the <head> section. The UTT handles click tracking and first-party cookie management.

Conversion Tracking

Impact's conversion pixel goes in Shopify's Additional Scripts section. Impact uses an iframe-based tracking method alongside their JavaScript pixel for redundancy.

Key variables to pass:

  • Order ID, revenue, currency
  • Customer ID (for new vs returning segmentation)
  • Coupon code
  • Product SKU, name, category, price, and quantity for each item

Impact Shopify Integration

Impact also provides a dedicated Shopify integration through their platform. This streamlines the setup by automatically configuring tracking and pulling product data from your Shopify catalogue.

CJ Affiliate Integration with Shopify

Site Tag

CJ's site tag goes in your theme.liquid <head> section. It handles page-level tracking and supports CJ's cross-device identity graph.

Conversion Tag

CJ's conversion tag fires on the order confirmation page. Add it to Shopify's Additional Scripts. CJ requires specific item-level parameters including CJ-specific action IDs and enterprise IDs that your CJ account manager will provide.

CJ's Shopify App

CJ offers a Shopify app (CJ Affiliate by Conversant) that automates much of the integration process. This is recommended for most merchants as it handles edge cases specific to Shopify's checkout flow.

Conversion Deduplication

If you run affiliate tracking alongside Google Ads, Meta Ads, and other paid channels, deduplication ensures you don't pay twice for the same conversion:

Channel Identifier Method

Pass a "channel" parameter with each conversion that identifies which marketing channel drove the last click. Your affiliate pixel should only fire when the last click came from an affiliate source.

Common Deduplication Approaches

  • JavaScript-based: Check the referring URL or UTM parameters before firing the affiliate pixel. If the last click was from Google Ads, suppress the affiliate pixel.
  • Server-side: Apply deduplication logic on your server before sending conversion data to the affiliate network. This is more reliable than JavaScript-based approaches.
  • Network-level: Some networks (including AWIN) support deduplication parameters that allow you to pass a channel identifier with the conversion. The network then validates against their own click data.

Shopify App Integrations

Several Shopify apps simplify affiliate tracking management:

  • AWIN's Shopify Plugin: Official integration for MasterTag, conversion tracking, and product feed management.
  • Refersion: A self-hosted affiliate platform with native Shopify integration. Good for brands wanting to run their own programme without a network.
  • UpPromote: Shopify-native affiliate management with built-in tracking, commission management, and partner portals.
  • GoAffPro: Free-tier affiliate management app for Shopify with basic tracking and commission features.

For brands using established networks like AWIN, CJ, or Impact, the network's official Shopify integration is always preferable to third-party alternatives.

Common Shopify Integration Issues

  • Cross-domain cookie loss: Solved by implementing server-side tracking as a backup.
  • Checkout Extensibility limitations: Shopify Plus stores using Checkout Extensibility have different pixel placement requirements. Consult your network's Shopify-specific documentation.
  • Currency conversion: Multi-currency stores must ensure the correct currency is passed with each conversion.
  • Subscription orders: Recurring subscription payments may require additional pixel configuration to track initial and recurring orders separately.
  • Discount code tracking: Ensure discount codes are passed correctly when multiple codes are applied (Shopify allows stacking in some configurations).

For a broader guide on launching your programme on AWIN, see our AWIN setup guide.

Frequently Asked Questions

Do I need Shopify Plus for affiliate tracking?

No. Standard Shopify plans support affiliate tracking through the Additional Scripts section for conversion pixels and theme editing for site-wide tags. Shopify Plus offers additional flexibility through Checkout Extensibility and Script Editor, but basic affiliate tracking works on all plans.

Can I run multiple affiliate networks on the same Shopify store?

Yes, but implement proper deduplication to avoid paying commission to multiple networks for the same sale. Each network's site tag can coexist, but only one conversion pixel should fire per transaction based on last-click attribution logic.

How do I handle Shopify's post-purchase upsells in affiliate tracking?

Post-purchase upsells (order bumps after checkout) may not be captured by the initial conversion pixel since they occur after the thank-you page loads. Use server-side tracking with Shopify webhooks (which capture the final order value including upsells) to ensure accurate commission calculation.

Will affiliate tracking slow down my Shopify store?

Modern affiliate tracking pixels have minimal performance impact. The MasterTag/site tags are lightweight and load asynchronously. Conversion pixels only fire on the thank-you page, so they don't affect browsing or checkout speed. Server-side tracking has zero impact on page load since it operates entirely on the backend.

Need help integrating affiliate tracking with your Shopify store? Book a free technical consultation via our Calendly and we'll ensure your tracking is accurate, reliable, and properly deduplicated across all channels.

Ready to Grow Your Business?

Get a free, no-obligation audit of your current digital marketing performance.

Get Free Marketing Audit