It's called "sub id" in the affiliate marketing world.
Every network has a different implementation of it, unfortunately. It's not a huge a pain to implement it differently for each network, but you just need to find out the variable to use.
The basic idea is to add the sub id variable in your affiliate link. This variable can be set to anything you like that allows you to reference it back to your source. I'll provide a detailed example below to explain.
Unless they changed it in the last few months, here are the variables for the popular networks:
Here is how VigLink and SkimLinks implement this:
1. They have a table of their customers in their db, each with an id (primary key).
2. When they construct the url for each of their customers' sites, they tack on the sub id variable of the network and set the value to their customer's id. So...
Where xxxx is their customer's id.
3. They have a script to routinely download the reports from the networks. Most provide a restful API for this.
4. The network reports will have each transaction populated with the sub id (xxxx) if you added it properly.
This is how they figure out where each converted sale came from and which one of their customers to compensate for it.
All the cash back programs (FatWallet, Ebates) work like this as well.
For my coupon sites network, I used sub id tracking for another use -- tracking which marketing channel that sale came from. That is powerful information to have in affiliate marketing. Because it allows you to figure out which of your marketing efforts are profitable and which aren't. It allowed me to remove Adwords keywords that didn't perform and bump up the CPC for ones that did.