Program Tracking Templates let you define additional query parameters that Affonso appends to the landing URL after a referral click is resolved.
You choose the parameter keys yourself. That means you can match whatever naming convention your stack already expects, whether that is partnerid, affiliate_id, source_partner, utm_campaign, or any other valid query parameter name.
Example:
- landing URL:
https://example.com?via=affiliate123 - appended parameters:
partnerid={tracking_id}andutm_campaign={program_slug} - final browser URL:
https://example.com?via=affiliate123&partnerid=affiliate123&utm_campaign=my-program
The main benefit is not shorter affiliate links. The main benefit is that affiliate traffic can be mapped into the parameter structure your analytics, CRM, backend, or internal reporting already uses.
Why teams use this
- Use your own query parameter schema
- Pass affiliate and program data into your analytics stack
- Standardize UTM naming across all affiliate traffic
- Feed internal systems that expect specific URL parameters
- Keep the same referral link format while enriching the landing URL
This is especially useful if you want affiliate traffic to show up consistently in:
- Google Analytics or PostHog
- your CRM
- ad attribution tooling
- internal BI or reporting systems
Common uses:
- add standardized UTM parameters like
utm_source=affiliateandutm_campaign={program_slug} - pass a partner identifier into your CRM or backend, for example
partnerid={tracking_id}
How macros work
Macros are placeholders that Affonso replaces automatically with real values when a visitor lands.
For example, partnerid={tracking_id} becomes partnerid=affiliate123 if the affiliate's tracking ID is affiliate123.
Available macros
| Macro | Description |
|---|---|
{affonso_id} | The unique Affonso referral ID created for the click. Best for stable click-level identification. |
{tracking_id} | The affiliate's public tracking code used in referral links, such as john-doe. |
{affiliate_id} | The internal Affonso affiliate ID. Useful when you want a stable partner identifier that does not depend on the public tracking code. |
{affiliate_name} | The affiliate's display name. Best for readable labels, not for strict identifiers. |
{group_id} | The ID of the affiliate's assigned group, if the affiliate belongs to a group. |
{group_name} | The name of the affiliate's assigned group, if the affiliate belongs to a group. Useful for reporting by partner segment. |
{program_id} | The internal Affonso program ID. |
{program_slug} | The program slug used by Affonso for the program. |
{program_name} | The display name of the affiliate program. Useful for readable campaign values. |
{timestamp} | The Unix timestamp generated when the click is resolved. Useful for time-based reporting or cache-busting. |
{randint} | A random integer generated when the click is resolved. Useful for cache-busting or external systems that expect a unique request value. |
Fixed values vs macros
- Use fixed values when the parameter should always stay the same, for example
utm_source=affiliate - Use macros when the value should change by affiliate, group, or program, for example
partnerid={tracking_id}orutm_campaign={program_slug}
You can mix fixed values and macros in the same setup.
How to set it up
You configure this under Affiliate Program → Tracking, then scroll to Advanced → Program Tracking Template.
- Go to Affiliate Program
- Open Tracking
- Scroll to Advanced
- Open Program Tracking Template
- Turn it on
- Add the parameters you want to append
- Save your changes
Affonso will add those parameters on future landings when they are missing from the current URL.
Good to know:
- these parameters are added in the browser after the page loads
- they may not be available on the very first server request
About affonso_id
Affonso can also append affonso_id to the landing page URL. This is enabled by default and should usually stay enabled.
Why it matters:
- it helps Affonso reconnect the visit later
- it is especially useful when cookie consent is delayed
- it improves attribution reliability across the session
If you use cookie consent or delayed consent, leave this enabled.
Not the same as Referral Parameters
Referral Parameters control the link format affiliates share, for example:
?via=affiliate123
Program Tracking Templates control which additional parameters Affonso adds after the visitor arrives.
They do not change the affiliate link itself:
- Referral Parameters decide how the partner link looks
- Program Tracking Templates decide what extra query parameters get added for your systems
See also:


