Affiliate campaign tracking with UTM
Affiliate programs measure cleanly when each affiliate has a distinct, stable label. This page shows how to use a per-affiliate utm_source or utm_content for attribution, and why an affiliate's identity must be an opaque code rather than personal data in a public URL.
Per-affiliate labelling
Give the program one medium and distinguish affiliates with a stable, opaque per-affiliate value. Many programs use utm_source for the affiliate, or keep one source and vary utm_content:
- utm_medium=affiliate (kept distinct and documented)
- utm_source=<affiliate code or slug> (or vary utm_content)
- utm_campaign=<the program or promotion>
- utm_content=<optional placement label>
Keep the payout data out of the URL
The UTM is for attributing traffic, not for carrying the affiliate's identity or commission terms. Putting an email, real name, or guessable sequential ID in the link exposes personal data in logs and invites enumeration or fabricated referrals.
Use an opaque code that your backend privately maps to the affiliate, and reconcile commissions server-side against that mapping. Keep the public UTM to a generic, non-identifying label, and make sure any affiliate short link redirects to a destination that still carries it.
How it appears in analytics and logs
A visit with utm_medium=affiliate and a per-affiliate label tells you which affiliate drove it, letting you compare partners within one program. The UTM is for traffic attribution, not for the payout record itself.
Diagnostic use case
Give each affiliate a distinct, stable label so you can attribute and compare affiliates from the same program, while crediting the sale through your own backend.
What WebmasterID can help detect
WebmasterID reads utm_medium=affiliate and the per-affiliate label at ingest and attributes the visit to that affiliate, so program traffic is measurable per partner without exposing who they are.
Common mistakes
- Putting an affiliate's email or real name directly in a UTM parameter.
- Using guessable sequential affiliate IDs that allow enumeration or fake referrals.
- Reusing one label for many affiliates so partners cannot be compared.
Privacy and accuracy notes
Use an opaque affiliate code or brand slug, never the affiliate's email, name, or bank details. The code is public in the URL and logs; keep payout-sensitive data behind your backend, not in the link.
Related pages
- Referral program UTM tracking
Referral programs need their own UTM medium so referred traffic is not confused with organic referrers. This page shows how to label the referral channel and explains why you must not encode individual user IDs in UTM — it leaks personal data and invites abuse.
- Partner / co-marketing UTM tracking
Co-marketing only measures cleanly when both partners tag links the same way. This page shows how to agree a shared utm_source naming and campaign convention up front, so a joint campaign aggregates instead of fragmenting across two different schemes.
- Privacy-first analytics
Attribute affiliate traffic without exposing partner identity in URLs.
Sources and verification notes
- MDN — URL search paramsUTM values live in the public query string and are logged.
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.