Skip to content

Discount-Code & Affiliate Sales Mastery · How affiliate and discount-code programmes work · lesson 1 of 12 · 14 min

The mechanics: codes, links, commission and cookies

The basic model

Affiliate and discount-code programmes pay you for sales you help generate. A brand (the merchant) gives you a unique way to identify customers you referred — usually a personal discount code, a tracked link, or both. When a customer buys using your code or link, the sale is attributed to you and you earn a commission or reward.

On Optimize All, brand campaigns can reward you for sharing campaign content and for sales made with your personal discount code. The details — commission rate, eligible products, dates, and how you report — are set out in each campaign brief. Always read the brief: it's your contract.

Codes versus links

| | Discount code | Tracked (affiliate) link | |---|---|---| | How it's tracked | Customer types code at checkout | Click stores an identifier (often a cookie or URL parameter) | | Works offline / in video / spoken | Yes — easy to say and remember | Harder — needs a clickable place | | Customer benefit | Usually a discount or gift | Not always | | Weaknesses | Codes can leak to coupon sites; customer may forget to enter it | Blocked cookies, different devices, or long gaps can break tracking |

Many sellers use both: a link for convenience and a code as a backup that also gives the buyer a reason to use it.

Key terms

  • Commission — your earnings per sale, usually a percentage of order value (sometimes excluding tax and shipping) or a fixed amount.
  • Attribution window / cookie duration — how long after a click a purchase still counts for you.
  • Last-click attribution — if a customer clicks several affiliates' links, the last one usually gets the credit. Codes often override links, depending on the programme.
  • Validation / locking period — a period during which sales can be reversed (returns, cancellations, fraud checks) before commission is confirmed.
  • Reversal / clawback — commission removed for returned, cancelled or invalid orders.
  • Payout threshold and schedule — minimum balance and timing for payment.
  • Exclusions — products, categories or order types that don't earn commission (for example, gift cards or items already on sale).

The economics — an illustrative example

Illustrative numbers only: a product costs 4,000 PKR. Your code gives buyers 10% off (so they pay 3,600), and you earn 8% commission on the discounted price — 288 PKR per sale. If 25 people buy in a month, you'd earn 7,200 PKR, before any returns are reversed. If three orders are returned, confirmed earnings fall to 6,336 PKR.

This shows two important truths: returns reduce earnings, and recommending the right product to the right people — which lowers returns — is financially smart as well as ethical.

Reading the terms: a checklist

Before you promote anything, check:

  1. What exactly earns commission (products, regions, new vs. returning customers)?
  2. What's the rate and is it on pre- or post-discount, pre- or post-tax value?
  3. Campaign dates and attribution window.
  4. How and when sales are validated, reversed and paid.
  5. Where you're allowed to promote (some programmes ban paid search on brand terms, coupon sites or certain platforms).
  6. Disclosure and content requirements.
  7. Prohibited behaviour (self-purchase, incentivised orders, misleading claims).

Worked example

Hamza, a gaming creator in Lahore, joins a headset campaign. Reading the brief, he notices commission applies only to orders delivered in Pakistan, excludes bundles, and requires orders to be reported with order IDs within the campaign window. He plans his content around the single headset, tells his UAE followers that the code won't work for them, and sets a reminder to submit his sales evidence before the deadline. No surprises at payout.

Code architecture: the five kinds of code you will meet

Not all codes behave the same way, and the type of code decides how reliable your attribution is.

| Code type | Example | Who uses it | Tracking strength | Leak risk | |---|---|---|---|---| | Vanity code (one per creator) | SARA10 | Most creator programmes | Good, easy to say | High: easy to copy to coupon sites | | Platform-specific code | SARA-YT, SARA-IG | Creators testing channels (where allowed) | Good, shows which channel converts | Medium | | Single-use unique codes | SARA-7KQ2 (one per buyer) | Giveaways, email lists | Excellent | Low | | Automatic discount via link | Discount applied when the link is clicked | Shopify and similar stores | Depends on cookies and devices | Low | | Store-wide public code | WELCOME10 | Brand's own marketing | None for you | Not yours |

Two practical rules follow. First, ask which code wins when a buyer clicks your link but types a different code at checkout: many programmes credit the code, some credit the last click. Second, ask whether your code can be stacked with a store-wide sale; if not, your code may be useless during the brand's own promotions.

How tracking actually works behind the scenes

  • Links: your tracked link carries an identifier (a URL parameter such as ?ref=sara or a network click ID). The store or network stores it in a first-party cookie or passes it to the server. Browser privacy features, ad blockers and switching devices can break this chain, which is why programmes increasingly use server-to-server (postback) tracking.
  • Codes: the order record in the store (for example Shopify or WooCommerce) stores the discount code used. The programme maps each code to a creator. This survives devices and browsers, but only if the buyer types it.
  • Networks and platforms: affiliate networks and platforms such as Awin, impact.com, CJ, PartnerStack, Amazon Associates or TikTok Shop's affiliate programme run the tracking and payouts for many brands; each has its own terms, windows and reporting.

Hands-on: build your programme terms sheet

Keep one row per programme so you can compare deals at a glance and answer "does this count?" without re-reading every brief.

programme,merchant,network_or_platform,code,link,commission_basis,rate,cookie_or_window_days,code_beats_link,stackable_with_sales,validation_days,payout_threshold,payout_schedule,payout_method,excluded_items,allowed_channels,banned_channels,self_purchase_allowed,brief_link,last_checked
Headset launch,GameGear PK,Optimize All,HAMZA10,https://example.com/r/hamza,post-discount excl. delivery,8%,30,yes,no,30,PKR 5000,monthly,bank transfer,bundles,YouTube; Instagram; WhatsApp channel,coupon sites; paid search on brand,no,https://example.com/brief/123,2026-09-20

Then calculate what one sale is really worth. Illustrative numbers only:

Price 4,000 PKR - 10% code = 3,600 paid
Commission 8% of 3,600 = 288 PKR per sale
Expected return rate (from brand or your history) 12%
Expected confirmed commission per sale = 288 x (1 - 0.12) = 253 PKR

Do and don't

Do read every brief fully. Do use both a code and a link where allowed. Do factor returns into your expectations.

Don't assume commission applies to everything on the site. Don't promote in channels the programme prohibits. Don't promise followers a discount you haven't confirmed.

Video lecture: The mechanics: codes, links, commission and cookies

Lecture coming soon · 13 chapters · about 9 minutes. Read the full transcript below.

  1. How programmes really work
  2. Why it matters
  3. The model
  4. Key terms
  5. Five kinds of code
  6. Behind the scenes
  7. Who runs the programme?
  8. Example 1: Hamza, Lahore
  9. Example 2 (illustrative): Dubai creator
  10. Watch me do it: terms sheet
  11. Common mistakes
  12. Measure it
  13. Recap + try this now

Lecture transcript

How programmes really work

Two creators promote the same headset with the same audience size. At the end of the month, one earns three times more than the other. Same product, same commission rate. So what happened? The difference was hidden in the fine print: which code counted, how long the tracking lasted, and how many orders came back. In this lecture you'll learn exactly how discount-code and affiliate programmes pay, the five kinds of code you'll meet, how tracking works behind the scenes, and how to build a terms sheet so nothing surprises you at payout.

Why it matters

Why does this matter? Because the commission rate is only one number, and it's often not the most important one. Attribution rules decide whether you get credit at all. Validation periods decide when you're paid. Exclusions decide which products count. And returns decide what you actually keep. Creators who understand the mechanics pick better programmes, set honest expectations and stop leaving money on the table. Brands notice those creators too, because they're easier to work with.

The model

Here's the basic model, with an analogy. Think of it like a restaurant giving you a stack of cards with your name on them. When a customer hands your card to the waiter, the restaurant knows you sent them and gives you a thank-you fee. The card is your discount code. A tracked link is more like a doorman who remembers your face for a while. Brilliant when it works, but if the customer comes back through a different door, or after the doorman's shift ends, you might not get credit. That's why most smart sellers use both.

Key terms

Now the key terms. Commission: what you earn per sale, usually a percentage of the order value, sometimes after discount and excluding tax and delivery. Attribution window, or cookie duration: how long after a click a purchase still counts. Last-click attribution: if a buyer clicks several creators' links, the last one usually wins, although codes often override links. Validation or locking period: when sales can still be reversed for returns, cancellations or fraud checks. And payout threshold and schedule: the minimum balance and the timing of payment.

Five kinds of code

Not all codes are equal. There are five kinds you'll meet. A vanity code, like SARA10: easy to say, but easy to copy to coupon sites. Platform-specific codes, like SARA dash YT and SARA dash IG, which show which channel converts, if the programme allows them. Single-use unique codes, one per buyer, brilliant for giveaways and email lists, and very hard to leak. Automatic discounts applied through a link, common on stores like Shopify. And the brand's own public code, like WELCOME10, which earns you nothing. Know which one you're holding.

Behind the scenes

How does tracking actually work behind the scenes? With a link, your click carries an identifier, a little tag in the web address. The store or network saves it, often in a cookie. But privacy features, ad blockers and switching devices can break that chain, which is why many networks now also use server-to-server tracking. With a code, the store's order record simply saves the code used, and the programme maps it to you. That survives any device. It only fails if the buyer forgets to type it. So say your code, show your code, and pin your code.

Who runs the programme?

Who actually runs all this? Sometimes the brand runs its own programme, straight from its store. Often a network or platform sits in the middle: affiliate networks like Awin, impact dot com or CJ, software platforms like PartnerStack for software brands, marketplace programmes like Amazon Associates or TikTok Shop's affiliate programme, and creator platforms like Optimize All. The middleman matters, because it sets the tracking method, the reporting dashboard, the validation rules and how you get paid. Two campaigns from the same brand can behave differently if they run through different platforms. So on your terms sheet, always record which network or platform the campaign runs through, and read that platform's terms as well as the brand's brief.

Example 1: Hamza, Lahore

First example, simple. Hamza, a gaming creator in Lahore, joins a headset campaign. He reads the brief and spots three things. Commission only counts on orders delivered in Pakistan. Bundles are excluded. And sales must be reported with order IDs within the campaign window. So he builds his content around the single headset, tells his UAE followers the code won't work for them, and sets a reminder to submit his evidence before the deadline. No surprises at payout.

Example 2 (illustrative): Dubai creator

Second example, a realistic business scenario with illustrative numbers. A beauty creator in Dubai compares two offers. Offer A pays fifteen percent, with a seven-day window, no stacking with sales, and a sixty-day validation period. Offer B pays ten percent, with a thirty-day window, a code that stacks with the brand's sales, and a thirty-day validation. On paper, A looks better. But her audience usually buys a week or two after watching, and the brand runs frequent sales. Illustratively, over a quarter, Offer B earned her noticeably more confirmed commission, and it was paid a month sooner.

Watch me do it: terms sheet

Watch me do it. I'm filling in my terms sheet for a new programme. Merchant, network, my code and my link. Commission basis: the brief says eight percent of the post-discount price, excluding delivery. Window: thirty days. Does the code beat the link? I can't find it, so I email support and note the answer. Stackable with sales? No. Validation: thirty days. Payout threshold: five thousand rupees, monthly, by bank transfer. Banned channels: coupon sites and paid search on the brand's name. Self-purchase allowed? No. Now the maths. Four thousand rupees minus ten percent is three thousand six hundred. Eight percent of that is two hundred and eighty-eight. With an expected twelve percent return rate, one sale is worth about two hundred and fifty-three rupees. That's the number I plan with.

Common mistakes

Common mistakes. Assuming commission applies to everything on the site. Ignoring the validation period and spending money you haven't confirmed. Not knowing whether your code works during the brand's own sale. Promoting in channels the programme bans, like coupon sites, and losing the commission. Promising followers a discount you haven't confirmed. And forgetting returns. A product your audience doesn't need is a product that comes back, and your commission goes with it.

Measure it

How do you know you're getting this right? Track three numbers for each programme. Your confirmed commission, after validation, not just pending. Your reversal rate: reversed orders divided by all orders. And your days to cash: the time from sale to money in your account. If a programme has a high reversal rate and a long wait for cash, it needs a very good rate to be worth your time. Your terms sheet makes that comparison easy.

Recap + try this now

Recap. Programmes pay for sales you help generate, tracked by codes, links or both. The rate is only one number: windows, stacking, validation, exclusions and returns decide what you keep and when. Know which kind of code you're holding, and how tracking breaks. Try this now: take one active campaign brief and fill in a row of the terms sheet from the lesson, including the value-per-sale calculation. If any cell is blank, ask the brand or platform before you post. Next, choosing products your audience will actually buy.

Video transcript

Let's demystify how you actually get paid for selling with a discount code or affiliate link. A brand gives you a unique identifier. Sometimes it's a code, like SARA10. Sometimes it's a tracked link. Often it's both. When someone buys using your code or link, the sale is attributed to you, and you earn a commission. Codes are brilliant for video and spoken content, because people can remember them. Links are convenient, but tracking can break if someone switches devices or waits too long. Using both gives you the best chance of getting credit. Now, the fine print matters. Every programme has terms: what earns commission, what doesn't, how long the attribution window lasts, and when sales are confirmed. Most programmes have a validation period, where returned or cancelled orders are reversed. That last point is important. If you push a product to people it doesn't suit, they return it, and your commission disappears. So recommending the right product to the right people isn't just ethical — it's the smart way to earn. Before you promote anything, read the campaign brief like a contract, because it is one. Check the rate, the dates, the eligible products and regions, how to report your sales, and what's prohibited — like buying with your own code. In this course, you'll learn how to pick products that fit, create offers and content that convert, place your code where it works, track and report sales correctly, stay compliant, and build repeat buyers who come back to you again and again.

Key takeaways

  • Programmes pay for sales you help generate, tracked by codes, links or both.
  • Know the commission basis, attribution window, validation period and exclusions.
  • Returns and cancellations reverse commission — fit reduces returns.
  • The campaign brief is your contract: read it before promoting.

Try it

Take one active or upcoming campaign brief and complete the seven-point terms checklist in writing.