Great question — answering as the UphillTech team:
Its often a tracking pixel. A tiny image, naked to the eye (usually 1 pixel wide by 1 pixel tall) is hosted on a server, and on the page you want tracked, you add the HTML or JS code that contains the link to the pixel Every time the page loads that has the pixel on, the pixel is fired (loaded), which is then recorded as an event of what ever you are tracking. Such as the pixel firing on a payment confirmation page. So its usually a pretty simple implementation of adding a js or html tracking code to a page. There is also Server-Based tracking which is not as simple to set up but more accurate. This is where information associated with the user, affiliate, and the offer is stored on a...
Full answer by Max: https://webmasters.stackexchange.com/a/116345 (CC BY-SA 4.0).
Need it done for your business? UphillTech.