0

I'm building an open source affiliate tracking system to release as a Codeigniter Spark and to incorporate into a few of my own projects. Anyway, at a basic level this is very simple stuff. This is how I'm tracking referrals:

User is referred to a specific endpoint (e.g. /ref/293203 with 293203 being the affiliate id) that sets a cookie, sets a session, and stores information about the user (their ip address and user agent). In this case, even if cookies are disabled, I can still match them either by sessions (which don't have to be cookie based) or by useragent + ip match. There are some other edge cases which this wouldn't cover, and I was hoping some of you might be able to provide some insight:

  1. User deletes cookies and revisits later from a different browser & ip address (ie, they check out something for the first time on their iPhone, but end up purchasing it from home on their computer)

  2. IP address and user agents match, but this user isn't actually unique (for example, I've worked from an incubator where all 40 people in the building are using the same static IP and many are using the same browser)

Any ideas on how to address those edge cases? Any others which I have not considered?

nneonneo
  • 171,345
  • 36
  • 312
  • 383
Calvin Froedge
  • 16,135
  • 16
  • 55
  • 61
  • 1
    How far did you get with the affiliate tracking system? I'd love use the spark plugin. – Abs Sep 28 '12 at 17:25

2 Answers2

1

I've written a number of affiliate tracking engines from scratch as well as helped build a number that are used by major affiliate networks, and unfortunately you have to either rely on cookies or use your 2nd other option. However i would recommend including more then just the IP address and user agent match. I have heard of some people using which plugins are installed in the browser, which language the browser is in etc. There have been studies done that I cant find a link for at the moment you can achieve a very high level of accuracy using a combination of browser metrics.

That being said i would not recommend relying on PHP sessions to track users as it will no longer work if you end up having enough traffic that will require additional servers where the session stored on one, will not be stored in the other (also the fact that PHP sessions rely on cookies anyway, so you may as well use your own).

Your other case you mentioned about deleting cookies or using a different device to complete the transaction are unfortunately impossible to tie together without some sort of unifying system that will let you associate multiple devices/browsers etc. Its always known to networks that there will be a untraceable drop off that is usually worked into the pricing structure that affiliates are paid out. Ie maybe you can expect that 15% of sales will not be able to be tied to an affiliate properly and that can be either extra money for you, or you can bump up your payout. (as you would expect, most just eat the profit =)

There is another method i will share a link for, I've seen it talked about many times however i have never seen a proof of concept showing that it will work using the caching ETAG header. http://kuza55.blogspot.com/2007/05/tracking-users-with-cache-data.html

Hope this helps, and good luck its a fun thing to write!

nneonneo
  • 171,345
  • 36
  • 312
  • 383
Shane Fright
  • 385
  • 1
  • 9
  • PHP Sessions don't necessarily rely on cookies. Most implementations use cookies, but the session can also be appended to the URL. I think that's fine for this case, because I'm only using it to track the referral. Thanks for the link and thanks for the input. Another idea we had was to do a reverse dns lookup in case the IP changes / refreshes. – Calvin Froedge Nov 17 '11 at 19:42
  • For sure, however in an affiliate tracking situation its ideal to not have to pass the session ID all the way through from click to landing page to conversion pixel. As it requires more integration on the merchants end in order to track the transaction properly. – Shane Fright Nov 17 '11 at 20:44
0

Checkout https://github.com/samyk/evercookie and I cannot WAIT until you release your spark.

Brad
  • 2,237
  • 5
  • 41
  • 69