For web shops · 21 October 2026 · 11 min read

Affiliate marketing for Shopify stores: setup, tracking and terms

Loui Wagner

Co-founder, product and technology

The short answer

  • Our Shopify app creates its own web pixel and builds tracking on a click ID and Shopify's checkout_completed event. The app is in review with Shopify and is not in the App Store yet, so a Shopify store cannot install it today.
  • Affiliate commission is only paid on completed, approved sales – unlike ads, where clicks and impressions cost money whether or not they turn into orders.
  • If a Shopify order is refunded, the commission is not rejected automatically: the store rejects the sale in the dashboard within the approval period. Automatic rejection exists for the WooCommerce plugin and Stripe.
  • Sensible starting terms are a rate worked out backwards from your gross margin and a cookie window between 14 and 90 days, chosen by how long customers take to decide.

Shopify is a platform where affiliate tracking needs very little setup. The store already has a structured checkout, orders with unique IDs and a fixed checkout event a web pixel can listen to. Those are exactly the three things an affiliate network needs to be able to say: this sale came from this click, and the commission only stands if the order does.

We have built a dedicated Shopify integration for Affilyflow, and in this guide we walk through the whole chain: why the business model fits the economics of a Shopify store, how the tracking works under the hood, the setup step by step, what happens with refunds, and which program terms are sensible to start with.

Why the affiliate model suits a Shopify store

The difference between affiliate marketing and paid ads is when the money leaves your account. With ads you pay for the chance of a sale: clicks and impressions cost money whether or not orders come out of them. With affiliate marketing you pay a commission on orders that were actually completed – and with us, only once the sale has been approved.

That changes the risk profile fundamentally. An ad account can burn through a budget over a weekend without a single order. An affiliate program only costs something at the moment an affiliate has brought in a sale that holds. In return, ads scale with the budget here and now, while an affiliate program has to be built up: affiliates need to find the program, assess it and produce content. So the two channels do not compete – each covers its own part of growth.

Affiliate marketing and paid ads compared
Affiliate marketingPaid ads
RiskLow – you only pay for completed sales, and rejected orders cost no commissionHigh – clicks and impressions cost money whether or not they convert
PaymentCommission on the order value, after approvalUp front or ongoing, regardless of the result
ScaleBuilt up over time through affiliates and their contentScales with the budget – and stops the day the budget does

How the integration works technically

The chain starts with the click. When a visitor clicks an affiliate link, the click hits our server, which records it and sends the visitor on to your store with an afid parameter in the URL. Two things are locked to the click right there: the commission rate and the attribution window. If you lower the rate later, the old rate still applies to clicks that have already happened – we call that rate lock. Known bots and crawlers are filtered out at the same time and get neither a click record nor attribution.

In the store, our Shopify integration listens through a web pixel. The pixel subscribes to Shopify's checkout_completed event, so when a customer completes a purchase it sends the order ID, the amount and the click ID the customer carries to our server. The pixel is the only way the order is reported – the app does not subscribe to Shopify's order or refund webhooks. The basis is Shopify's subtotal, meaning the value of the goods without shipping; if VAT is included in your prices, we take it out using the order's own tax breakdown. The server looks up the click, checks that it is still inside the cookie window that was locked at the click, and creates the conversion. The window is decided on the server from the click's actual time – the browser cannot lie about how old a click is.

The same order can never count twice: orders are deduplicated on the order ID per program. And everything is created as pending – a conversion never credits a balance automatically, it waits for approval. The whole flow is described in more detail under tracking.

Important

Everything is logged – including what did not become a sale

Every tracking event is written to an event log, including checkouts without an affiliate reference. That makes it possible to troubleshoot the setup with data instead of guesswork.

Setup step by step

01

Install the app

Install the Affilyflow app in Shopify. It creates the web pixel and your Affilyflow account itself, so there are no theme files to edit and no account to create first. If you already have an account with us, you connect it in the app with a six-digit code from the dashboard. The app is in review with Shopify and is not in the App Store yet, so this step can only be completed once it is. Write to us and we will let you know.

02

Choose your terms

Choose the commission rate and cookie window in the app, and write a description affiliates can assess. There is no subscription – the program only costs something when there are sales. Sales in any currency with a daily ECB rate are recorded and converted to Danish kroner at the rate on the day of the sale – the rate is locked on the sale. Balance, commission and payouts are settled in Danish kroner (DKK) today.

03

Make a test purchase

Click the test link in the Affilyflow app and complete a purchase in the store. The test sale is free, is marked Test under Sales and does not count in any figures or invoices, so it needs neither approval nor rejection. That way you know the chain works before the first affiliate gets going.

04

Become visible to affiliates

The program appears in our program directory as soon as it is active – via the Shopify app once you have chosen a commission in the app; if you create the account on affilyflow.com, once your email is confirmed.

05

Handle sales as they come in

New sales are pending. You have the program's approval period (30–90 days) to reject them with a reason – after that they are approved automatically, so a sale is never pending longer than the program's period of at most 90 days.

Tip

The test purchase is your most important step

Test all the way to a completed checkout – not just that the link redirects. The test sale through the app's test link is free and does not need rejecting, but it proves that the whole chain from click to recorded sale works.

Refunds: reject the sale in the dashboard

The classic weak spot in an affiliate setup is what happens after the sale. A customer changes their mind and the order is refunded – but the commission is still in the system. The Shopify pixel only reports the purchase, not a later refund, so a refunded or cancelled Shopify order is something you reject yourself in the dashboard, with a reason, before the approval period approves the sale. It is a manual clawback, so do it as you go rather than reconciling a list of refunds when the deadline is near.

The automation exists today for the WooCommerce plugin and Stripe: if a WooCommerce order is refunded or cancelled, or a Stripe payment is refunded or disputed, the commission is rejected automatically – even if the sale has already been approved – and the affiliate is notified. On Shopify, it is the store's job.

Program terms: where a Shopify store should start

The commission rate has to make the numbers work for both sides. Start from your gross margin and your average order value and work backwards: what can you pay for a sale and still make money? A worked example: if you sell for DKK 800 excluding VAT with a gross margin of 40 %, you have DKK 320 to play with per order. A total price of 10 % costs you DKK 80: DKK 64 in commission to the affiliate and DKK 16 in network fee – and leaves DKK 240 for everything else. Note that we calculate commission on the order value excluding VAT – via the Shopify app on the value of the goods without shipping and VAT.

You choose the cookie window yourself, between 14 and 90 days. A short window suits impulse purchases with a short decision time, a long one suits more expensive products where the customer compares for weeks. If in doubt, start with 30 days – that is our recommendation and the default in the dashboard and the Shopify app. You can adjust it later, and every click keeps the window that applied when it happened.

  • Rate: work backwards from gross margin and order value – and remember the rate only costs anything on sales that hold
  • Cookie window: 14–90 days, chosen by how long customers take to decide
  • Description: write who the program is for and which channels you want – affiliates pick programs they can stand behind, and who you should go after yourself is covered in how to choose affiliates for your program

One more thing is worth knowing before you set the rate: it can only be lowered once every 30 days, and clicks that have already happened keep their locked rate. The rule is enforced by the database, not just the dashboard. So set a rate you can stand by – not a teaser rate you will have to cut after launch.

The economics: your total price and the affiliate's rate

Our business model is simple: you set your total price per sale. Our network fee is 20 % of it, and the other 80 % goes to the affiliate. If you set your total price at 10 % of an order worth DKK 1,000 excluding VAT, the sale costs DKK 100: the affiliate gets DKK 80, and DKK 20 is the network fee. There is no subscription and no fixed costs – no sales, no bill. The fee can only be changed by us, and like the rate rule it is enforced by the database. Read more about the model under payments, and the technical description of the app is in the docs under tracking on Shopify.

For affiliates, only approved commission can be paid out, and the payout threshold is DKK 100 – approved commission is paid out automatically on the first banking day of the month. That matters to you as a store too: your affiliates know pending sales cannot be withdrawn, so your approval is the real milestone. The faster you handle sales, the more attractive your program is to work for.

Watch out

Automatic clawback does not apply to Shopify

Automatic rejection on refund exists for the WooCommerce plugin and Stripe. A refunded Shopify order is something you reject yourself in the dashboard within the approval period – otherwise the sale is approved automatically.

If you want the full plan for the program – from recruitment to the numbers you should follow – read affiliate marketing strategy for web shops. If you are ready to get started, create your program – and if you have questions about your specific setup, write to us.

Frequently asked questions

Does affiliate marketing on Shopify need a developer?

No. Affilyflow's Shopify app creates the web pixel that listens for completed purchases itself, so there are no theme files to edit. The app is in review with Shopify and is not in the App Store yet, so a Shopify store cannot install it today. The setup consists of installing the app, choosing your terms in the app and making a test purchase with the app's test link.

What happens to the commission if a Shopify order is refunded?

It is not rejected automatically. The Shopify app only reports the purchase through a web pixel and receives no refund webhook, so the store has to reject the sale in the dashboard with a reason within the approval period. Automatic rejection exists for the WooCommerce plugin and Stripe.

How quickly does a Shopify store have to approve affiliate sales?

All sales are created as pending, and the store has the program's approval period (30–90 days) to reject them with a reason. If nothing happens before the deadline, the sale is approved automatically. Only approved commission can be paid out to the affiliate.

What does it cost to run an affiliate program on Shopify?

There is no subscription with Affilyflow. The store sets its total price per sale; the network fee is 20 % of it, and the other 80 % goes to the affiliate. Via the Shopify app, commission is calculated on the value of the goods without shipping – whether VAT is deducted in every case has not yet been confirmed on a live VAT-registered store. Rejected sales cost nothing.

Further reading

Written by

Loui WagnerCo-founder, product and technology

Found a number that no longer holds? Write to us – we will correct the article.

From reading to the first click.

Web shops only pay for approved sales, and affiliates are up and running in minutes – with numbers that can be checked.