Skip to main content
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:
  1. Records the click with your affiliate ID
  2. Sets a first-party cookie on the visitor’s browser
  3. Tracks the visitor across the cookie window (typically 30-90 days)
  4. 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
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 WindowsDuration
Short30 days
Standard60 days
Long90 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

ParameterDescription
utm_sourceTraffic source (youtube, twitter, newsletter)
utm_mediumMedium (video, post, email)
utm_campaignCampaign name
utm_contentContent variant
utm_termSearch term
sub1 - sub5Custom 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.