Technology and tracking

Affiliate code

Also called referral code, partner code, affiliate coupon code, tracked discount code.

Short answer

An affiliate code is the unique string that identifies a specific affiliate. It appears in two places: in the address of the affiliate link, where a click on it generates a click ID, and as a discount or referral code the customer types in at checkout.

Definition of Affiliate code.

The link code sits in the address itself – typically as the last part of a redirect, such as /go/CODE. When someone clicks, the code is looked up, the affiliate is identified, the click is recorded as its own row, and the visitor is sent on to the store with a tracking parameter in the URL. This is the form that produces a click ID and therefore a timestamp an attribution window can be counted from.

The discount or referral code works without a click. The customer hears the code in a video, a podcast, a post or in print, types it into the basket and usually gets a discount. The sale is tied to the affiliate because the order carries the code – not because there was a visit to measure. That makes this form useful wherever there is nothing to click.

The code must be unique per affiliate and unambiguous within the program. If the same string is reused across several programs or affiliates, sales cannot be allocated afterwards, and a mistake in assignment cannot be fixed without moving money between parties. That is also why codes normally must not be changed once they have been shared.

When a code beats a link

Anywhere nobody can click: podcasts, radio, print, product packaging, the stage at an event, or a video where the viewer does not open the description. A code also survives being written down on a piece of paper and typed in two days later from a completely different device – no cookie can manage that.

On top of that, the code is immune to the browser's limits on tracking: it only depends on the customer remembering to type it.

What the code cannot do

Without a click there is no click ID, no timestamp and therefore no attribution window to enforce. So the code cannot prove the sequence of events: it shows that the customer knew the code, not when or where they came from.

Codes also spread on their own. A customer who shares the code on a forum or a coupon site can trigger commission for customers who have never seen the affiliate's content. Code-based tracking is therefore strong on reach and weak on attribution – the opposite of a link.

Affiliate code vs. affiliate link

AspectAffiliate codeAffiliate link
How the sale is tiedthe order carries the codethe conversion carries the click ID
Requires a clicknoyes
Attribution windowcannot be enforced – there is no click to count fromlocked at the click
Can be passed onyes, and often isonly by copying the link
Works offlineyesno

Use the link where people can click and the code where they cannot – and accept that the code buys reach at the cost of precision.

How it goes wrong

  • 01

    The code ends up on coupon sites

    A code circulating in public credits the affiliate for customers she never brought in. The terms should take a position on passing the code on before it is shared.

  • 02

    The same code in several programs

    If a string is reused across stores or affiliates, sales cannot be allocated afterwards. The code must be unambiguous within the program it belongs to.

  • 03

    The code is the only channel

    Without clicks you only have the sales and no idea how many people saw the recommendation. There is neither CTR nor EPC to optimise, only a total number of orders.

At Affilyflow

Affiliate code in practice

Affilyflow's links are built around a code: /go/ followed by the affiliate's own. When the code is looked up, the click is created as its own row, and the program's rate, type and attribution window are copied into it. The age of the window is decided afterwards on our server, not in the browser, so the client cannot lie about how old the click is.

Known bots get neither click recording nor attribution, and the same order can never count twice: deduplication is done on order or invoice ID per program.

The store can also tie a discount code to a specific affiliate. Such a personal code earns the affiliate commission without a click, while a code for all affiliates does not earn commission by itself. A valid click always wins over a code, and the commission for a sale via a code is the program's rate at the time of the sale.

Frequently asked questions

What is the difference between an affiliate code and an affiliate link?

The link ties the sale to the affiliate through a click that gets its own ID and its own timestamp. The code ties the sale to the affiliate because the order carries the code, without any click. The link gives precise attribution, the code gives reach where nobody can click.

Can a sale be tracked without a click?

Yes, with a discount or referral code the customer types in at checkout. The sale is tied to the affiliate because the order carries the code. On the other hand, there is no click ID and no timestamp, so an attribution window cannot be enforced.

Can the same affiliate code be used in several programs?

No. The code must be unambiguous within the program it belongs to, otherwise sales cannot be allocated correctly afterwards. The same affiliate can easily have several codes, one per program.

Why does a discount code not count as a click?

Because there was no visit to record. A click happens when someone opens the affiliate link, and that is where the click ID, timestamp and attribution window are locked. A code typed into the basket only carries the information about who should be credited.