Understanding the mechanics of affiliate tracking allows you to confidently answer questions from your affiliates about how their sales are attributed.
The Click (Day 1)
- An affiliate (let's call him John) shares his link:
yoursite.com/?ref=john123. - A customer clicks the link and lands on your homepage.
- The
track.jsscript immediately reads the URL parameter?ref=john123. - The script saves
john123in a First-Party Cookie nameddma_aff_ref. - The script also attempts to save the value in the browser's
localStorageas a fallback.
The Cookie Lifecycle
By default, the cookie is set to expire in 90 days.
This is known as the "Attribution Window". If the customer leaves your site on Day 1 without buying anything, but comes back directly to yoursite.com on Day 45 and makes a purchase, John still gets the commission because the cookie is still active.
Last-Click Attribution
We use a standard "Last-Click Attribution" model.
If a customer clicks John's link on Monday, but then clicks Sarah's link on Wednesday, the cookie value is overwritten from john123 to sarah456. If the customer buys on Thursday, Sarah gets 100% of the commission.
The Conversion
When the customer finally clicks "Buy Now" and completes a transaction through your payment provider (e.g., Stripe or Paddle):
- The payment provider pings our Discover Mac Apps webhook.
- The webhook payload contains the customer data and custom data/metadata.
- If you passed the
dma_aff_refcookie into the checkout metadata, we attribute that sale to the affiliate. - The commission is instantly logged in the dashboard as
Pending.