If you visit the site, put stuff in your cart and get all the way to the checkout page, you must know by that point who sent them to your site. If the customer then goes away and googles for voucher codes, it shouldn't change the source. When (if?) they return, you should know they are the same person, from the same original source.
How did the affiliates manage to steal these customers? It seems to me like your referral tracking is massively broken.