# Affiliates overview

Affiliate and referral workflows depend on one thing: preserving attribution from the first click through checkout completion.

## Attribution path

1.  A visitor clicks a campaign, partner, or affiliate link.
2.  The affiliate platform captures its click/referral identifier; pass it as checkout metadata. Use `pf_ref` separately when the campaign needs a promo participant reference.
3.  Your integration supplies the referral identifier as metadata when checkout starts.
4.  Checkout opens with the same visitor and campaign context.
5.  Purchase events, invoices, webhooks, and integrations can use that context.

## Promo participant link (separate from affiliate metadata)

```html
<a href="https://example.com/pricing?pf_ref=partner_123">
  View offer
</a>
```

## Checkout with attribution

```js
await plandalf.present("pro-plan", {
  metadata: {
    partner: "partner_123"
  }
});
```

## Related docs

-   [Affiliate attribution](https://plandalf.com/docs/product-guides/affiliates/attribution)
-   [CTA links and redirects](https://plandalf.com/docs/product-guides/promos/cta-links)
-   [Live events](https://plandalf.com/docs/packages/sdk/interfaces/FlowEvent)

Source: https://plandalf.com/docs/product-guides/affiliates/overview
