Skip to content
LITE
Tracking & attribution

How attribution works

4 min readUpdated August 2026Applies to: Lite & Pro

Three routes credit a referral, and they are checked in a fixed order so two affiliates can never claim the same sale.

A visit to https://yoursite.com/?ref=jane records a first-party visit and sets a first-party cookie. The parameter name and the cookie window are both configurable. Because the cookie is first-party, a browser or an ad blocker stripping third-party scripts does not quietly stop crediting the referral — there is no third-party script to strip.

The default model is first-touch: once the cookie is set, a second link from a different affiliate does not overwrite it — Jane keeps the credit even if the visitor later clicks Mikael’s link too, unless you switch the attribution model to last-click. Either way, every valid link click is logged as a visit regardless of whether it changes the cookie, so a click that didn’t win attribution still shows up in the affiliate’s click count — it just didn’t convert the referral.

A campaign parameter rides alongside the referral: ?ref=jane&campaign=spring records spring on the visit, and it also accepts utm_campaign as an alias, so an affiliate who built their link in a marketing tool with UTM tags already on it does not need to add a second, parallel parameter. The campaign travels with the cookie and expires with it, so a sale is traced back to the specific push that produced the click rather than to whatever page the buyer happened to be browsing at checkout.

If the site spans subdomains — a blog on one, checkout on another — the cookie can be shared across them by pointing squad_affiliate_cookie_domain at the shared parent domain, since a cookie set on the exact host a visitor lands on does not travel to a different host by itself, and a browser will not let one site write a cookie for another it doesn’t own.

2. Coupon code#

A coupon tied to an affiliate credits them on any order that uses it — no link, no cookie, no click. This is what makes an influencer programme work when the audience hears a code on a podcast and types your domain directly.

3. Customer binding#

Once a customer has been referred, you can bind them to that affiliate permanently, so repeat orders keep paying the person who found them. This fallback only fires when a purchase carries no fresh cookie or coupon attribution of its own, and only when you’ve actually turned it on — lifetime commissions and recurring-renewal commissions are each their own filter, off by default, so a customer binding sitting unused in the database does nothing to a sale until one of them is switched on. The binding itself is first-touch and permanent: the first affiliate a customer is bound to keeps that customer, and a later referral link or coupon from someone else cannot rebind them.

One order, one commission#

If a visitor arrives on Jane’s link and then uses Mikael’s coupon, exactly one of them is paid — the order the routes are checked in decides, and it is the same order every time. Double-crediting is not a setting you can get wrong.

What is recorded#

Every visit stores the referrer, the landing URL, the campaign and the visitor’s IP. The IP is not truncated at write time — it’s anonymised later: a daily job clears the stored address on any visit older than your retention window, while leaving the rest of the row (referrer, landing page, campaign, whether it converted) in place for reporting. Set the window to 0 and IPs are kept indefinitely. The commission is calculated when the order completes, not when the click happens — so an abandoned cart costs an affiliate nothing and earns them nothing.

When attribution is wrong#

Open the referral and look at its visit. The landing URL and referrer are recorded on the row, which usually answers the question in one glance: a missing campaign means the link was shortened by someone who dropped the query string, and a referrer from your own domain means the visitor bounced through an internal page that reset it.