All articles

Shopify attribution

How to run a Shopify affiliate program without editing your theme

Start with affiliate discount codes and native paid-order webhooks. No theme.liquid change is needed until you want link attribution.

Published · Last reviewed

Written by Attribloom Engineering · Reviewed by Attribloom Product · Last reviewed

Discount codes first

The fastest way to launch a Shopify affiliate program is to skip storefront code entirely. Connect your store, approve an affiliate, then create a Shopify discount whose code exactly matches the referral code on that affiliate's Attribloom detail page. Hand the code to the affiliate. When a shopper uses it at checkout, Shopify includes it in the paid order and Attribloom matches it to the affiliate.

Attribloom calls this a validated discount code: a Shopify checkout code that exactly matches an affiliate referral code already recorded in Attribloom. There is no theme edit and no storefront script involved.

How the sale is confirmed

Shopify emits HMAC-signed paid-order and refund webhooks from its own servers. Attribloom verifies the signature, reads the discount code, and credits the matching affiliate. Commission is calculated on the post-discount merchandise subtotal, excluding tax and shipping, and a refund reverses the matching share on a double-entry ledger.

  • No storefront pixel: the order is confirmed from Shopify's server-side webhook.
  • Commission basis: post-discount merchandise subtotal, excluding tax and shipping.
  • Refunds, full or partial, reverse the matching commission automatically.

The limit of discount-code attribution

Discount codes only credit an affiliate when the shopper actually enters the code. A visitor who arrives from an affiliate link but checks out without the code is not attributed. If you want to credit a visit without asking the shopper to type a code, you add link attribution, which reads a ?ref parameter and preserves it on the cart. That is the one case that warrants a small theme.liquid change.

Most programs start code-only and add link attribution later, once the affiliate channel is worth the storefront change. The two paths can run together, and Attribloom fails closed if a discount code and a ref value ever identify different affiliates.

Sources and verification

Primary documentation last checked on 2026-07-20. Each source below links the exact page and its own last-checked date.

Next steps

Frequently asked

Do I have to edit my theme to run a Shopify affiliate program?

No. The discount-code path needs no theme or storefront change. A theme.liquid edit is only required if you later add link attribution that credits a visit without a discount code.

What does the discount-code path miss?

It only credits a sale when the shopper enters the code. A shopper who came from an affiliate link but did not use the code is not attributed unless you add link attribution.

How is the commission amount calculated?

On the post-discount merchandise subtotal in the store's currency, excluding tax and shipping. Refunds reverse the matching share.

In the glossary

Continue reading

App Store attribution

How to attribute App Store subscriptions to an affiliate

App Store attribution

Why iOS affiliate installs are invisible to web attribution tools

Shopify attribution

How to attribute Shopify sales to affiliates without third-party cookies

Pricing models

Commission-only vs revenue-share affiliate programs

App Store attribution

How to validate App Store attribution before release

Payouts

How commission holds and clawbacks protect an affiliate program

iOS program launch

How to start an affiliate program for an iOS app

Shopify program launch

How to launch a Shopify affiliate program

Program economics

Affiliate commission rates: 2026 benchmarks by industry and how to set yours

Program policy

Affiliate program agreement template (2026): full contract and clause guide

Creator strategy

AI UGC vs human creators for affiliate marketing

Custom attribution

How signed conversion postbacks and refunds work

App Store attribution

How to attribute App Store subscription renewals to an affiliate

App Store attribution

RevenueCat affiliate attribution for iOS subscriptions: a server-side pattern

App Store attribution

Affiliate-aware paywalls on iOS: pass referral context without fingerprinting

App Store attribution

iOS affiliate tracking without an SDK: StoreKit 2, appAccountToken, and server notifications

App Store attribution

SKAdNetwork vs affiliate attribution for iOS subscriptions

Shopify attribution

Shopify affiliate link tracking with cart attributes: a theme.liquid recipe

Compliance

FTC affiliate disclosure: the complete 2026 guide (rules, examples, placement)

Attribution concepts

What is deferred deep linking? A plain-English guide for attribution
Get startedSee pricingMore articles