Affilyflow Docs
Everything you need to set up Affilyflow
Tracking setup for stores, technical reference for developers and an API for affiliates – in one place, written from how the product actually works.
Where do you want to start?
I run a webshop
Set up tracking, test a purchase and make your program visible to affiliates.
I am an affiliate
Links with sub-IDs, measured pages, program rules and payouts.
I am a developer
The tracking script, the sale line, server-side tracking and the API for affiliates and AI.
Choose your platform
Every guide follows the same three steps as Setup in the dashboard: choose a platform, install, test tracking.
Shopifyabout 3 min
WooCommerceabout 5 min
Stripeabout 15 min · needs a developer
Smartweb / HostedShopabout 5 min
DanDomain Classicabout 5 min
Shoporamaabout 10 min
Magento 2about 15 min · needs server access
PrestaShopabout 10 min
Shopware 6about 10 min
- OpenCart10–30 min
Webflowabout 5 min
- Custom-built store5–30 min
Which route fits your store?
Tracking has two jobs: remember the affiliate's click when the customer lands, and report the sale with its order number and amount. How that happens depends on where you sell.
| You sell on | How the sale is tracked | Guide |
|---|---|---|
| Shopify | The app creates the pixel and your account – no code. | Shopify |
| WooCommerce | Our plugin tracks from your own server and reports refunds. | WooCommerce |
| Smartweb, HostedShop, DanDomain, Shoporama | The tracking code on every page plus a sale code on the order confirmation – the platform fills in the order number and amount. | Smartweb, DanDomain Classic, Shoporama |
| Magento 2 | Our module tracks from your own server and reports refunds. New – install it on a test environment first. | Magento 2 |
| PrestaShop, Shopware 6 | The tracking code on every page; the sale is read from the platform's own Google Analytics 4 module. | PrestaShop, Shopware 6 |
| Webflow | The tracking code in the site's custom code plus one line on the order confirmation that reads the order number and amount from the page. | Webflow |
| Custom-built store (e.g. Laravel or PHP) | Scan your site: if it already sends the purchase to Google Analytics, it takes one line in total. Otherwise, one line on the order confirmation. | Custom-built store |
| Stripe Checkout and Payment Links | A webhook reports one-off purchases, subscriptions and refunds. | Stripe |
If you have a developer, server-side tracking keeps working on iPhone and with ad blockers too. If you use Google Tag Manager, the script can be set up with our tag template, and if your domain has its DNS at Cloudflare, a Cloudflare Worker can store the click from your own host. Your server can also report leads, sales after a lead and subscriptions outside Stripe – see Leads and subscriptions.
How it fits together
- An affiliate shares a link. The click goes through Affilyflow and lands on the store with a click ID in the address (
?afid=c_…). - The store's tracking remembers the click – the Shopify pixel, the WooCommerce plugin or
track.js. - The customer buys. The sale is reported to Affilyflow with the order number and amount and linked to the click.
- The commission is locked on the click and approved once the approval period has passed, unless the store rejects the sale.
Read the whole journey in How tracking works.
Test before you go live
Every store has a test link under Program → Setup, in the Test tracking step. A test purchase through it earns no commission and no fee, and the page shows the click, the order number and the amount straight away – including how the amount was calculated. See Testing and troubleshooting.
For developers and affiliates
- Developers: track.js, the sale line, the Google Analytics route, the conversion API and status codes.
- Affiliates: links and sub-IDs, the REST API and MCP for AI assistants.
Everything in the docs
Get started3 pages
- How tracking worksHow a click on an affiliate link becomes a sale with locked commission – and what happens along the way.
- Getting started as a storeFrom a new account to a program affiliates can find – account, price, tracking and a test purchase.
- Getting started as an affiliateFrom account to first payout – create an account, add your sites, find programs, create links and follow your results.
Stores24 pages
- ShopifyTracking with the Affilyflow app – a Web Pixel and orders from Shopify's server, no code in your theme.
- WooCommerceInstall our free plugin and paste in your connect code – clicks and sales are tracked from your own server.
- Smartweb and HostedShopTracking on Smartweb, HostedShop and the new Dandomain Webshop – a script in the design and a sale code in the affiliate field.
- DanDomain ClassicTracking on the older DanDomain engine – the tracking code in the site's code field and the sale code on Bestil step 4 (order step 4).
- ShoporamaThe tracking code in an HTML field and the sale code in the theme's thanks.html – with the amount excluding VAT and shipping.
- Magento 2Install our free Magento 2 module and paste the connect code – clicks and sales are tracked from your own server. New: test it on staging first.
- WebflowThe tracking code in the site's Custom code and one line on the Order Confirmation page – no template variables needed.
- PrestaShopTracking on PrestaShop via Google Analytics 4 – the tracking code in the theme and the official ps_googleanalytics module. No module from us yet.
- Shopware 6Tracking on Shopware 6 via Google Analytics 4 – the tracking code in the theme and GA4 on the sales channel. The standard confirmation page is read without GA4 too.
- OpenCartTracking on OpenCart 3 and 4 via Google Tag Manager and Google Analytics 4, a sale line on the confirmation page or your own server. No module from us.
- Custom-built storeSet up tracking on a store that was built for you, e.g. in Laravel or PHP – without knowing any field names.
- Google Tag ManagerSet up tracking from Google Tag Manager with our tag template – with Google Consent Mode built in and without touching your site's code.
- Server-side trackingLet your own server store the affiliate click and report the sale – so tracking holds up on iPhone, in Safari and with ad blockers.
- Cloudflare WorkerStore the affiliate click as a cookie from your own host with a Cloudflare Worker – for platforms where you can't put code on the server.
- StripeTrack sales from Stripe Checkout, Payment Links and Stripe Billing with a webhook – one-off purchases, subscriptions, refunds and disputes.
- Testing and troubleshootingProve that tracking works with a test purchase – and find the cause when a sale doesn't come through.
- Consent and cookiesWhat tracking stores in the customer's browser, for how long – and how the script can wait for consent to marketing.
- Personal discount codesA discount code you give to one specific affiliate earns commission – even when the customer never clicked a link.
- Commission by categoryGive a category, a brand or a single product a different rate from the standard one – e.g. 0% on gift cards or more on high-margin products.
- Leads and subscriptionsReport leads, sales after a lead and subscription renewals – from your server or with one click under Sales when a quote becomes an order.
- Approval and refundsThe approval period, how to reject a sale, and when a refund is corrected automatically.
- WebhooksGet every sale through an affiliate on your own server as it happens – and again when it is approved, rejected or refunded. Signed, with retries and a log.
- Products and feedHow your products get into affiliates' product search – from your shop or from a Google Shopping or CSV feed.
- Multiple stores and teamKeep several webshops under one login, switch between them in one click, and give colleagues access with the role they need.
Reference5 pages
- track.jsComplete reference for the tracking script – attributes, JavaScript API, what is stored in the browser, consent and errors.
- The sale lineReport the sale with a single line of HTML on the receipt page – no JavaScript, and Danish amounts are parsed correctly.
- Google AnalyticsLet track.js read the purchase from Google Analytics 4 with data-sale="ga4" – no code on the receipt page.
- Conversion APIThe endpoint that receives sales – for server-side and custom integrations, with parameters, responses and limits.
- Status codesWhat each status from the conversion endpoint means – and what to do about it.
Affiliates8 pages
- Links and sub-IDsHow to create tracking links, deep links to specific products, sub-IDs and HTML that shows the exact page every click came from.
- Saved products and product boxesSave products with one click, see in the dashboard when a product sells out, drops in price or gets a new commission, and put your products on your site as a product box, comparison table or grid.
- Page trackingSee exactly which page on your site each click came from – automatically with the HTML snippet, with placement.js or through your own redirect.
- Program rulesApproval period, channels, paid search, coupon sites, what happens if a rule is broken – and how rule changes are announced.
- PayoutsAutomatic payout on the first banking day of the month from DKK 100 – bank details, personal details, self-billing, VAT and what happens with refunds.
- REST APIThe affiliate API under /api/v1 – keys, limits, every endpoint with parameters and responses, pagination and error codes.
- PostbacksGet the sale in your tracker or on your server as it happens – and again on approval, rejection and refund. With macros, a signature, retries and a log.
- MCP serverConnect Claude, ChatGPT, Claude Code or Cursor to your Affilyflow account – setup, sign-in, the 28 tools, prompts and limits.
For AI agents
Every page is also available as Markdown (add .md to the address), and the whole documentation is in one file for your coding assistant.