Documentation Index
Fetch the complete documentation index at: https://dub-partner-network.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The attribution flow
Dub uses a multi-stage attribution model that tracks the complete customer journey from initial click to final purchase:Stage 1: Click tracking
When a visitor clicks a partner’s referral link, Dub captures the click server-side before redirecting to your website. This happens automatically and cannot be blocked by ad blockers.
- Unique click ID
- Timestamp
- Geographic location (country, city, continent)
- Device type (mobile, desktop, tablet)
- Browser and operating system
- Referrer URL
- UTM parameters
- Whether the click came from a QR code or a short link
dub_id query parameter:
dub_id parameter and stores it as a first-party cookie.
- Persist across page navigation and sessions
- Not blocked by ad blockers (unlike third-party cookies)
- Compliant with privacy regulations
- Work reliably across all browsers
expiresInDays parameter.
Stage 2: Lead tracking

customerExternalId + eventName. Only the first event for each combination is recorded, preventing duplicate attribution.
Stage 3: Sale tracking

Attribution models
Dub supports two attribution models:Last-click attribution (default)
All credit goes to the most recent partner link the customer clicked before converting.First-click attribution
All credit goes to the first partner who introduced the customer, regardless of subsequent clicks.| Model | Behavior |
|---|---|
| Last-click | The dub_id cookie is overwritten with each new click. The most recent partner gets credit. |
| First-click | The original dub_id cookie is preserved. The first partner retains credit. |
Attribution window
The attribution window is the timeframe during which a conversion can be credited to a click. In Dub, this is controlled by the cookie lifetime:| Configuration | Default | Description |
|---|---|---|
expiresInDays | 90 | Days the dub_id cookie persists |
Cross-domain attribution
If your customer journey spans multiple domains, Dub supports cross-domain tracking as well:yoursite.com→app.yoursite.comapp.yoursite.com→checkout.yoursite.comyoursite.com→anothersite.com
Partner commission flow
When a sale is attributed, Dub automatically calculates and records the partner’s commission:- Sale event received with
customerExternalId - Customer lookup finds the associated lead and original click
- Partner identified from the click’s referral link
- Commission calculated based on the reward rules for the partner’s group
- Commission created with
pendingstatus
Direct sale attribution
For scenarios without a signup flow (e.g., one-time purchases), you can track sales directly with the click ID:Direct sale tracking bypasses the lead event. This means lead-based rewards
are not created—only sale commissions.
Deferred lead tracking
For products with qualification periods (trials, approvals), Dub supports deferred lead tracking:Troubleshooting attribution
Common issues
| Issue | Cause | Solution |
|---|---|---|
| Conversions not attributed | dub_id cookie missing | Verify SDK installation and allowed hostnames |
| Wrong partner credited | Last-click model with multiple clicks | Consider first-click model if appropriate |
| Duplicate leads | Same customer tracked twice | Ensure consistent customerExternalId |
| Missing commission | Sale tracked before lead | Track lead event first, or use direct sale tracking |
Verifying attribution
- Check the cookie: Inspect browser cookies for
dub_id - Test the flow: Click a partner link, sign up, and verify the lead appears in your dashboard
- Review analytics: Check the Events tab for click → lead → sale progression