How Affiliate Tracking Works

Understand how Discover Mac Apps tracks affiliate clicks, first-party cookies, Safari ITP handling, and payment webhook attribution.

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)

  1. An affiliate (let's call him John) shares his link: yoursite.com/?ref=john123.
  2. A customer clicks the link and lands on your homepage.
  3. The track.js script immediately reads the URL parameter ?ref=john123.
  4. The script saves john123 in a First-Party Cookie named dma_aff_ref.
  5. The script also attempts to save the value in the browser's localStorage as 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):

  1. The payment provider pings our Discover Mac Apps webhook.
  2. The webhook payload contains the customer data and custom data/metadata.
  3. If you passed the dma_aff_ref cookie into the checkout metadata, we attribute that sale to the affiliate.
  4. The commission is instantly logged in the dashboard as Pending.
Was this article helpful?
Still need help? Contact Support