Affiliate Marketing Guide

Understanding How Affiliate Tracking Works

New affiliates ask a lot of questions (as they should), but some of the most common questions I see almost on a daily basis have to do with affiliate tracking.

How to correctly set up a postback URL? What needs to be passed to the affiliate network in the offer link? How do I use macros or tracking tokens? Conversions aren't recording!?!

There are hundreds of guides to setting all that up, but what I've noticed is there are almost no guides that actually explain affiliate tracking works.

Once you understand tracking, you can work with any affiliate tracker (Voluum, Binom, BeMob, etc.), as well as any affiliate network and traffic source.

Affiliate Tracking with ClickIDs

All of the affiliate tracking systems work like a giant database. When a user passes through one system, such as a click tracker like Voluum, they are assigned a unique clickID.

This clickID identifies the user, or click.

Each click usually has a bunch of data associated with it, such as browser, OS, country, IP address, etc.

Everything about that user is associated to their clickID.

With affiliate tracking, everything is associated with the clickID
With affiliate tracking, everything is associated with the clickID

When you want to see what the conversion rate for the Windows operating system is, the tracker searches for all the clickIDs that used Windows and then checks how many of those clickIDs converted and gives you the result.

Different systems can call the clickID something different, but most affiliate trackers these days will call them a clickID.

Traffic sources usually have their own unique name for clickID. Zeropark calls it cid and Adsterra calls it subid_short, but they are both unique IDs for each click.

Fixed Names in Database

Some databases will have fixed names for the slots where you can store data in. Affiliate networks usually have something like s1, or sub_id1 (or another variation of that) to store information about the click.

Trackers are kind of the same, but they allow you to change the names of the slots to what you need to be compatable with the traffic source you're working with.

Example traffic source template in Binom Tracker for the Zeropark traffic source
Example traffic source template in Binom Tracker for the Zeropark traffic source

The tokens can all be changed depending on the traffic source requirements. The above example is for Zeropark.

Zeropark actually has more tokens than what's above, but trackers are usually limited by how many custom variables they can have, so we have to select what's most important for us.

Passing Information Between Systems with GET Requests

The thing that makes affiliate marketing confusing is that there are usually three different systems you need to pass information - the traffic source, your tracker, and the affiliate network.

If we owned all three, tracking would be a breeze because the same system could track the entire user's journey.

In the affiliate marketing world, the systems pass information like this:

  • The traffic source shows an advertisement and has to pass information to your tracker about what ad the user clicked on. They are assigned an externalID (traffic source clickID).
  • When the user clicks on your ad, they get redirected through your campaign tracking link and are assigned a clickID by your tracker.
  • This clickID is passed to the affiliate network and then for the sake of this example let's say they converted on the offer.
  • The affiliate network then needs to pass the clickID they received from your tracker back so it knows what user converted.
  • Finally, the tracker needs to pass the externalID back to the traffic source so they know what user converted.

Because the traffic source had the first interaction with the user, they have to receive back their externalID instead of the clickID generated by your tracker.

Diagram illustrating how affiliate tracking works from the point the user clicks to when they convert
Diagram illustrating how affiliate tracking works from the point the user clicks to when they convert

The tracker saves both the externalID and clickID of the user because not all traffic sources have externalIDs, so in that case the user is identified by the clickID in the tracker

One of the standard ways to pass information around on the Internet is through GET requests.

Sound confusing?

Well, the fact is that you probably see GET requests everyday. A GET request is added on to a URL to give the server information.

https://nicklenihan.com/?s=landing+page

Whenever you see a URL with a ? in it, that's a query string, which forms the GET request. In the example above, the query string is s=landing+page. It's telling my website to search for the query "landing page".

All GET requests have a name and value (query string). In this case the name is s and the value is landing+page.

If you are going to send multiple pieces of information to a web server, then you just add additional names and values separated from the first pair with an &.

https://nicklenihan.com/?s=landing+page&utm_source=blogpost

If you had more than two pieces of information to pass, all additional ones would be separated with an &. The ? is only used once in front of the first name and value.

Depending on the affiliate network, they can use GET requests to record what affiliate sent the click, or just for subIDs to store data.

Peerfly Link
http://trkurk.com/123456/54321?s1=1&s2=2

ClickDealer Link
https://cdown.com/?a=12345&c=54321&s1=1&s2=2

Remember that the names (s1 or s2) in the GET request usually have a fixed name, but the values (1 or 2) can be whatever you want them to be.

Dynamic Tracking Tokens

In the case with affiliate tracking. You don't want to send the same clickID to the affiliate network for every user that clicks your call to action.

If you had to change this manually for every visitor, you could forget about having a life.

So instead of specifying a single value to pass in our link, we can use dynamic tracking tokens from our tracker.

What are tracking tokens?

Tracking tokens are a piece of text that are recognized by the tracker and replaced automatically at the right time. For example, when the user clicks.

They start and end with at least one symbol and vary a lot depending on who you're working with, but common symbols are: { and }, [ and ], # and #.

Symbols are necessary so the tracker can identify exactly what needs to be replaced. Without them, the names and values of your GET requests could get replaced when we only want the values to change.

Each affiliate network, traffic source, and tracker should have a list of the tokens they use if you search on Google. If you can't find it, reach out to your account manager, AM, or support for help.

A Real Example to Show How it All Comes Together

I bet you're still extremely confused as to how affiliate tracking for CPA campaigns actually works.

That's ok.

But, by now you should have enough information to actually understand what you're doing.

Now I'm going to show you a real example with BeMob as the tracker, Zeropark as the traffic source, and ClickDealer as the affiliate network.

Offer URL from ClickDealer

When you get your affiliate link from your ClickDealer dashboard, it will look something like this:

https://secureconv-smart.com/?a=12345&c=140999

We are going to be passing information to ClickDealer in this case. The above link already has a GET request, passing a (affiliate ID) and c (campaign ID).

This will ensure you get a commission for any conversions that happen and that the user is directed to the right campaign.

But, in order for ClickDealer to pass that conversion to BeMob (our tracker) we need to add another GET variable to the link with BeMob's clickID.

Some affiliate networks don't allow you to use s1 for non-unique values (ie. clickIDs), so by habit, I always use s2 to pass the clickID to the affiliate network.

We do that by adding the token as the value in the name-value pair s2={clickId}.

Adding a Clickdealer offer to BeMob with the {clickId} token
Adding a Clickdealer offer to BeMob with the {clickId} token

Now, when someone arrives at our ClickDealer offer, {clickId} will be replaced with their actual unique clickID and stored in the affiliate network under the name s2.

Campaign URL for Zeropark

The campaign URL generated by out tracker tells the traffic source (Zeropark in this case) where to send people after they click on our ads, or, when they display a popup ad to the user.

In your tracker, you should have a template for each traffic source. The template allows for your tracker to automatically add the tokens the traffic source uses to your campaign URL so they can be replaced when your ad is shown, allowing your tracker to save that data about the user.

Zeropark traffic source template inside of BeMob
Zeropark traffic source template inside of BeMob

Each of the custom variables will be added to your campaign URL so they can be replaced when you ad is shown

When you create a campaign in your tracker, you select which traffic source you are going to use so the right tokens are added to the link.

After generating a campaign link for our offer, the link looks something like this:

https://mycustomtrackerurl.com/go/20f9a006-1a96-4423-b5e3-7e6b92450ab8?cid={cid}&target={target}&source={source}&creative_number={creative_number}&carrier={carrier}&target_id={target_id}&browser={browser}&target_url={target_url}&campaign_id={campaign_id}&campaign_name={campaign_name}&os={os}

If we used a different traffic source, the tokens in the link would change because they use a different system that recognizes different tokens.

Now we have a URL that passes information to our tracker, and then our tracker redirects to the affiliate network, passing the clickID generated by the tracker to the affiliate network.

Postback URL from ClickDealer

The next step is to set up your postback URL at your affiliate network so our tracker knows what clickIDs converted.

Each tracker has a different format for the postback URL, but they all work the same. For BeMob, it looks something like this:

https://abcde.bemobtrk.com/postback?cid=REPLACE&payout=OPTIONAL&txid=OPTIONAL

ClickDealer has nearly 20 tokens you can use, so let's take a look at them:

Available tracking tokens for the Clickdealer affiliate network
Available tracking tokens for the Clickdealer affiliate network

Earlier we passed our clickID from our tracker in the s2 slot, or Sub ID 2. The clickID is all our tracker needs to know about the click because everything else the tracker knows about the user is associated with it.

In case our payout changes, it's a good idea to also send the payout you got for the conversion. Our final postback URL in ClickDealer will look like this:

https://abcde.bemobtrk.com/postback?cid=#s2#&payout=#price_usd#

We used #price_usd# in the post back because we work in US dollars and some of their offers pay in Euros.

Now when a conversion happens, your postback URL will be triggered. When this happens ClickDealer automatically fills in the unique clickID from your tracker, replacing , #s2# token with the real value you passed when the click happened.

Traffic Source Postback URL (Optional)

This last step is optional. I say that because some affiliates don't do this because they don't trust their traffic source.

If you send back all your conversions to the traffic source, they could, in theory, steal your campaign.

However, doing this step will allow you to see your conversions at the traffic source, making campaign optimizations easier for you because all the conversion data will be right in front of you when you are blacklisting or whitelisting.

Your traffic source postback is placed in your tracker in the traffic source template. When your tracker receives a conversion from your affiliate network, it can then send the conversion data to the traffic source.

The postback URL for Zeropark looks something like this (I've already filled in the tokens):

http://postback.zerodirect1.com/zppostback/54a65d4a56d4fas-54ds65ads54a-5sd54as6d?cid={externalId}&payout={payout}

The tokens you use in this link are from your tracker. The externalID token is {externalId}. This was the slot your tracker saved the traffic source's clickID when they showed your ad. Remember that it's different than the clickID the tracker generates.

BeMob's tokens can be found here. Each tracker has different tokens, so be sure to check the correct documentation depending on what tracker you're using.

Final Words About Affiliate Tracking

Affiliate tracking is confusing, but if you fully understand the above you can literally work with any affiliate network, any tracker, and any traffic source.

Just remember that each network, tracker, and traffic source has their own tokens and you must check their documentation when setting up your links.

Nick Lenihan the Affiliate Marketing Wizard

Nick Lenihan

Performance marketer, consultant, and affiliate marketing wizard. Hire me or subscribe to my YouTube channel.