Affiliate link tracking: how a tracking link works and how to check it

Affiliate link tracking explained: domain, redirect, macros and sub IDs, click ID, streams and offer rotation, checking that a link isn't broken, and common mistakes.

Illustration: one tracking link splits traffic through filters to different landing pages

Affiliate link tracking starts with a simple rule: the ad doesn’t point to the affiliate link, it points to your tracking link. The affiliate link with your ID sits behind it as the offer URL. The tracker between the ad and the network records every click with its ad tags, decides where to send the visitor and passes the click ID to the network so the conversion comes back to where it started. Below: what a tracking link is made of, how macros and streams work, how to rotate landing pages and offers, how to check that a link isn’t broken, and the most common mistakes.

The affiliate link is the offer URL from your CPA network’s dashboard: it contains your affiliate ID, the offer ID and parameters for your tags, e.g. https://partner.example/?aff=123&offer=45&sub1=.

The tracking link is what you put in the ad: https://go.your-domain.com/promo1/ plus the ad network’s tags.

Why add a layer instead of sending traffic straight to the network:

  • the network sees only its own clicks and conversions, not your creative, ad set or placement;
  • without a tracker you can’t change the offer or landing page, or split traffic by country, without re-uploading the ads;
  • your own domain in the ad doesn’t depend on the reputation of the network’s domain;
  • a conversion from a postback is tied to a specific ad, so ROI is calculated for every setup.

Take a link for TikTok:

https://go.example.com/promo1/?utm_source=tiktok&campaign_name=__CAMPAIGN_NAME__&adgroup_id=__AID__&ad_id=__ADID_V2__
  • The domain go.example.com is yours, with an SSL certificate. A subdomain works just like a root domain.
  • The alias promo1 tells the tracker which campaign this is.
  • The tags after ? are the ad network’s macros. TikTok replaces __CAMPAIGN_NAME__, __AID__ and __ADID_V2__ with the campaign name, ad group ID and ad ID at click time. Meta uses a different syntax: {{campaign.name}}, {{adset.id}}, {{ad.id}}.

What happens when someone taps the ad:

  1. The ad network fills in the macros and adds its own click ID: fbclid for Meta, ttclid for TikTok.
  2. The tracker receives the request, records the click with its tags, country, device and IP, and assigns a click ID.
  3. The tracker picks a route — stream, landing page, offer — and shows the landing page or redirects to the offer.
  4. The tracker fills its own macros into the offer URL: https://partner.example/?aff=123&sub1={click_id}&sub2={sub_id_1}. The network receives the click ID and will return it in the postback.

Don’t mix up the two layers of macros. Ad network macros (__CID__, {{ad.id}}) live in the ad URL and are filled by the network. Tracker macros ({click_id}, {sub_id_1}) live in the offer URL and are filled by the tracker.

Tags and sub IDs: what to pass#

The minimum for reading your stats is campaign, ad group and ad — ideally both ID and name: IDs are more reliable for joining data, names are easier to read in a report. Add the creative and placement if the network provides them. These tags then become report breakdowns: you see which creative brings deposits and which only brings clicks.

In the affiliate link, besides the click ID, it helps to pass one or two tags — for example, the ad ID. Then the network’s dashboard also shows where orders came from, and it’s easier to reconcile numbers when they don’t match.

A stream is a separate route inside a campaign. One ad, one link, but visitors split by conditions:

  • mobile users from Spain go to a Spanish landing page, everyone else to a general one;
  • Android and iOS go to different offers;
  • night hours go to an offer whose call center works 24/7;
  • traffic from different placements or media buyers splits by a tag value in the link, such as utm_source.

A “default” stream with no conditions takes everything that didn’t match the others. If there is none and no filter matched, the click goes nowhere — a common reason for “lots of clicks, zero leads”.

Rotating landing pages and offers#

There are two ways to split traffic between several landing pages or offers.

Weighted rotation. Streams weighted 70 and 30 get roughly 70% and 30% of clicks. Handy for gradually moving traffic to a new offer. Pin returning visitors to the same stream, or they’ll see different landing pages.

A/B test. A fair comparison of two landing pages needs a 50/50 test with a sample size calculated in advance. Weighted rotation shows who is ahead right now but doesn’t tell you whether the difference is random.

Separately — caps and a fallback offer. The network gives you a daily lead cap; once it’s used up, traffic to that offer is wasted money. Your tracker should switch clicks to a fallback offer on its own and return them to the main one the next day.

Before launch — by hand:

  1. Open the ad link in incognito on a phone. Replace the macros with test values, e.g. campaign_name=test.
  2. Check the tracker’s click log: the click is recorded, the tags are there, the right stream was picked.
  3. Look at the address you were sent to: the network’s parameter must contain a real click ID, not {click_id}.
  4. Go through the landing page to the end: the button leads to the offer, the form submits, the thank-you page opens.
  5. Check the link from the campaign’s country: speed and availability elsewhere can differ from yours.

After launch you can’t keep up by hand: the network turns off an offer at night, the domain’s SSL expires, the ad network starts blocking the domain. This is where monitoring comes in — automatic checks of the link and the offer every few minutes, an alert, and pausing the ads if traffic has nowhere to go. It’s also worth checking your domain’s reputation regularly: if the browser shows visitors a dangerous-site warning, no offer will convert.

Common mistakes#

  • Encoded macros. A URL editor turned {{ad.id}} into %7B%7Bad.id%7D%7D, and the network doesn’t recognize it. Keep macros as they are.
  • A macro wasn’t filled in. Your stats show __CID__ instead of the creative ID — the link was opened outside the ad or the macro syntax is wrong.
  • Two ? in one link. In a URL that already has parameters, the next one is added with &.
  • Changing the alias of a live campaign. The old link in your ads stops working.
  • No default stream. Traffic that doesn’t match any filter goes nowhere.
  • The click ID in the wrong parameter. You pass it in sub1, but the network’s postback returns sub2.
  • One domain for everything. One domain banned by an ad network — and every campaign on it is at risk.

lidvanto is a traffic control center for teams and solo media buyers. Everything above is in its tracker:

  • Link in the form https://your-domain/alias/; leave the alias empty and 8 random characters are generated. Domains connect through your team’s Cloudflare, and SSL is issued automatically. See Campaigns and links and Domains and Cloudflare.
  • Ad network tags. In the Ad network tags section, the TikTok Ads and Facebook Ads templates fill in the network’s macros; besides UTM there are 30 sub IDs. The tracker stores fbclid and ttclid by itself.
  • Offer macros: {click_id}, {sub_id_1}…{sub_id_30}, UTM, {country}, {os}, {device} and more. See Offers.
  • Streams — intercepting, regular and default; filters by country, device, OS, browser, language, IP, schedule, bots, referrer, ISP and URL parameter; rotation by position or by weight with visitors pinned for 30 days. If a campaign has no landing page, no offer and no default stream, its page shows a Clicks lead nowhere warning. See Streams and filters.
  • A/B tests of two landing pages, 50/50, with a sample size calculation. See A/B tests.
  • Caps and a fallback offer: daily click and lead caps, a fallback offer for when the cap is reached, the offer is turned off or down — up to three steps along the chain.
  • The link monitor regularly checks the campaign link and the offer site; a failure means the link stays unavailable, not a single error. Alerts go to the CRM, push and optionally Telegram; linked TikTok campaigns can be paused automatically. More in Landing page and offer checks, Link monitor and the blog post.
  • Speed by country (for campaigns with a lidvanto landing page): the tracking link and landing page are opened from servers in the countries you pick, so you see where the page loads slowly. The offer itself isn’t opened.
  • Domain checks: lidvanto regularly checks the domain’s reputation, and optionally also in VirusTotal with your team’s key. A blocked domain is marked At risk when you pick it for a campaign.

Limitations: lidvanto is a cloud service, you can’t install it on your own server. Automatic pausing on a broken link works for TikTok campaigns; for other sources you get a notification.

The link is half the job; the other half is bringing the conversion back to the click. How postbacks, pixels and CAPI, statuses and hold work is in the guide on affiliate conversion tracking.

FAQ#

Can I put the affiliate link directly in the ad?
You can, but then you only see what the network shows you: no breakdown by creatives and ad sets, no offer changes without re-uploading the ads, no own domain. It’s acceptable for testing one setup, not for scaling.

What is a sub ID in an affiliate link?
A parameter where you pass your own tag: click ID, ad ID, campaign name. The network stores it with the order and returns it in the postback or shows it in its stats.

How do I check that a tracking link works?
Open it with test tags in incognito, find the click in the tracker’s log, check that the offer URL contains a real click ID, and go through the landing page to the form. After launch, turn on link and offer monitoring.

Why does my report show __CAMPAIGN_NAME__ instead of the campaign name?
The ad network didn’t fill in the macro: the link was opened outside the ad, the macro has a typo, or a URL editor encoded it.

Do I need a separate domain for every campaign?
Not necessarily, but keeping everything on one domain is risky: if an ad network blocks it, every campaign stops. Subdomains are convenient — just watch the reputation of each.

What’s the difference between weighted rotation and an A/B test?
Rotation splits traffic in a set proportion. An A/B test splits it 50/50, pins each visitor to a variant and shows a winner only when the difference is significant.