How to pass sub-IDs from a prelander to your tracker

By PLCloaker team · · 6 min read

Team working on laptops with campaign charts on the screens

A sub-ID is a value you add to a tracking link so that a click, and later a sale, can be traced back to where it came from: which affiliate, which traffic source, which creative. When a prelander sits between the click and the offer, it has to pass those values on. If it does not, the conversion still happens, but nobody can tell which source earned it.

What is the difference between a sub-ID, a click ID and a transaction ID?

  • Sub-ID: any value you choose to segment traffic, such as the affiliate, the source or the placement. Trackers usually offer several slots (sub1 to sub5, s1 to s5, aff_sub to aff_sub5).
  • Click ID: a unique value the tracker creates for one click, used to match the conversion back to that click.
  • Transaction ID: the same idea under another name in some trackers; it identifies the click session that a conversion belongs to.

The rule for all three is the same: whatever arrives with the click must leave with the visitor when they continue to the offer.

Why do sub-IDs get lost on a prelander?

Three mistakes cause most lost conversions:

  1. Hard-coded buttons. The call-to-action points to a fixed offer URL, so the parameters from the incoming link are never added.
  2. Wrong parameter names. The entry link uses one tracker’s names and the offer expects another’s, so the values arrive under names nothing reads.
  3. Broken encoding. A value with a space or an ampersand splits the URL, and everything after it is lost or misread.

How do parameter names differ between trackers?

The same concept has different names depending on the platform. A typical mapping looks like this:

ConceptEverflowAffiseTUNE (HasOffers)
Affiliatesub1 / affidsub1 / pidaff_sub / affiliate_id
Clicktransaction_idclickidtransaction_id
Sourcesource_idsub5source

Names and available slots depend on how your tracker account is set up, so check your own tracker’s link builder. The point is that the prelander should receive values under one set of names and hand them to the offer under the names the offer expects.

How should sub-ID values be encoded?

A URL has reserved characters with special meaning, such as ?, &, = and /. A value that contains them must be percent-encoded, or the URL will be split in the wrong place. In JavaScript, encodeURIComponent() does this for a single value: it escapes everything except letters, digits and - _ . ! ~ * ' ( ).

For example, a product name and an image link passed as sub-IDs:

  • Smooth & Clear Body Care Set becomes Smooth%20%26%20Clear%20Body%20Care%20Set (or + for spaces in form-style query strings).
  • https://example.com/product.jpg becomes https%3A%2F%2Fexample.com%2Fproduct.jpg.

One exception matters: do not encode the tracker’s macros. A macro such as {affiliate_id} or {transaction_id} is replaced by the tracker when the link is clicked. If the braces are encoded, the tracker no longer recognizes it and the literal text is passed instead of the value.

A step-by-step setup

  1. Build the entry link with your tracker’s macros, for example /r/offer?s1={affiliate_id}&s2={transaction_id}&source_id={affiliate_id}.
  2. Map each incoming name to the name the offer URL expects.
  3. Make every exit on the page (buttons, images, links) go through the same redirect, so none of them drops the parameters.
  4. Encode fixed values you add to the offer URL, and leave macros untouched.
  5. Test with sample values: click through the page and confirm each value arrives at the offer under the right name.
  6. Check a test conversion in the tracker to confirm it is attributed to the right affiliate and source.

How PLCloaker handles it

In PLCloaker you choose the tracker for each offer, and the entry link is generated with that tracker’s macros. Incoming values are mapped to the advertiser’s parameter names and forwarded on every exit from the page, and the sub-ID helper encodes text and links for you while keeping macros intact. Clicks that arrive without the required IDs can be sent to a fail redirect instead of the page. See sub-ID tracking on the features overview, or read what a prelander is if you are just getting started.

Written by the PLCloaker team

We build PLCloaker and run affiliate traffic with it every day. Questions or corrections: contact us.