Your Referral Link
Every affiliate gets a unique referral code. Your tracking link follows this format:
https://merchant-site.com/?ref=YOUR_CODE
When someone clicks your link, AgentRef:
- Records the click with your affiliate ID
- Sets a first-party cookie on the visitor’s browser
- Tracks the visitor across the cookie window (typically 30-90 days)
- Attributes any conversion back to you
Referral Code
Your referral code is set when you join a program. It’s usually your name or brand:
https://example.com/?ref=jane
https://example.com/?ref=techreviewer
https://example.com/?ref=ai-tools-blog
Cookie Duration
Each program sets a cookie window – the number of days a click stays valid. If a visitor clicks your link today and purchases within the window, you get credit.
| Typical Windows | Duration |
|---|
| Short | 30 days |
| Standard | 60 days |
| Long | 90 days |
The merchant configures this per program.
UTM & Sub-ID Tracking
You can append tracking parameters to your links for your own analytics:
https://example.com/?ref=jane&utm_source=youtube&utm_campaign=review
https://example.com/?ref=jane&sub1=header-banner&sub2=homepage
Supported Parameters
| Parameter | Description |
|---|
utm_source | Traffic source (youtube, twitter, newsletter) |
utm_medium | Medium (video, post, email) |
utm_campaign | Campaign name |
utm_content | Content variant |
utm_term | Search term |
sub1 - sub5 | Custom sub-IDs for your own tracking |
These are tracked per click and visible in your affiliate dashboard.
Attribution Model
AgentRef uses last-click attribution: the last affiliate link clicked before conversion gets the commission. If a visitor clicks affiliate A’s link, then later clicks affiliate B’s link and purchases – affiliate B gets credit.
Viewing Your Clicks
In the Dashboard
Your dashboard shows click analytics: total clicks, unique visitors, click-through rates, and geographic breakdown.
Via API
Use the affiliate self-serve clicks endpoint to inspect a specific reporting window:
const stats = await fetch(
'https://www.agentref.co/api/v1/me/clicks?startDate=START_DATE&endDate=END_DATE',
{
headers: { Authorization: 'Bearer ak_aff_YOUR_KEY' },
}
).then((r) => r.json());
Use sub-IDs (sub1-sub5) to track which content, placement, or campaign drives the most conversions. This helps you optimize your promotion strategy.