Key takeaways
- A tracking SDK is a small client library that captures the click ID on landing and reports conversions back to the tracker.
- Its core jobs are reading and persisting the click ID, then firing a conversion call with that ID, value, and order reference.
- The SDK is the client-side counterpart to server-to-server postbacks — they can work together.
- Use the SDK for client-side conversions; use a raw postback for server-completed orders.
- Afflio ships a tracking SDK that captures the click ID and reports conversions over cookieless S2S.
An affiliate tracking SDK is a small amount of code that does two jobs reliably so you don't have to reinvent them: catch the click ID when a referred visitor lands, and report the conversion when they buy. Understanding what's inside it — and how it relates to server-to-server postbacks — tells you when to reach for the SDK and when a raw postback is the better tool.
What does an affiliate tracking SDK do?
An affiliate tracking SDK captures the click ID from an inbound affiliate link, persists it across the user's session, and later fires a conversion event back to the tracker with that click ID attached. It packages the fiddly, easy-to-get-wrong parts of client-side tracking — reading the ID, storing it, and reporting reliably — into a few function calls.
What are the core functions inside it?
Two functions do the real work: one runs on landing to capture attribution, the other runs at conversion to report it.
- Initialize / capture: on page load, the SDK reads the click ID from the inbound URL and stores it (for example in local storage) so it survives navigation through your site.
- Track conversion: at the point of sale, you call the SDK's conversion function with the value and a unique order reference; it attaches the stored click ID and sends the event to the tracker.
- Optionally, the SDK exposes helpers for the click ID and for setting customer context, but capture-and-convert is the heart of it.
Persistence is the hard part the SDK handles
The reason an SDK earns its place isn't the network call — it's persisting the click ID correctly across page loads and sessions so it's still there at checkout. Hand-rolled tracking usually breaks exactly here: the ID is captured on landing and lost before the conversion. A good SDK makes that survival the default.