Background
⌘K

Configure Program Tracking Templates

Append your own query parameters to affiliate landings so analytics, CRM, and internal systems receive the values they expect.

Silvestro
Written by Silvestro
Updated more than a week ago

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} and utm_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=affiliate and utm_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

MacroDescription
{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} or utm_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.

  1. Go to Affiliate Program
  2. Open Tracking
  3. Scroll to Advanced
  4. Open Program Tracking Template
  5. Turn it on
  6. Add the parameters you want to append
  7. 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:

Was this article helpful?

If you still need help, our support team is here for you.

Contact Support
bg

Ready to Scale Your SaaS?

Affonso is the easiest way to launch your own affiliate program. We take care of the technical stuff, so you can focus on growing your business.