Web Hosting Talk







View Full Version : Affiliate link click tracking


ivytony
01-24-2008, 03:13 PM
As you may know fatwallet.com where members can get cash back if they shop through fatwallet links.

I'm going to do a similar website/forums. I know how to cloak affiliate links to make them look better. However, I don't know how to track who clicks affiliate link and if (s)he makes a purchase or not.

I am wondering if anyone here can give me a hint. I appreciate your reply.

dollar
01-24-2008, 03:23 PM
Well as you know you'll have a link such as:

http://www.example.com/?affilid=1005 (just for an example).

What I would suggest is using PHP (or any other language you'd like) to take a look for the affilid variable whenever anybody accesses your site.

After you have the ID you can track the user with a cookie or a session. I would suggest doing both.

You should have a script that checks if the user came to the page with the affiliate ID. If they did it then sets a cookie for the user tracking what affiliate ID they came to the site with. It also sets a session variable for the user tracking what ID they came to the site with.

On the order page once (or rather if) they make a purchase then you again check the session and cookies to see if an affiliate ID is present. If it is present then you would credit the affiliate with the sale.

Does that help?

ivytony
01-24-2008, 03:55 PM
thanks for the fast reply. That's really helpful!

So when I add affiliate link at the backend, I'd also need to tell it what its order page is?

thanks again ;)

dollar
01-24-2008, 03:58 PM
If it was me I would have a file setup that checks on any page of the website to see if the affilid has been passed to it.

i.e.

<?php
if(isset($_GET['affilid'])) {
// Create the cookie and session variables
}
?>

And then on the order page (just one order page) after payment has been confirmed:

<?php
if(isset($_SESSION['affilid'])) {
// Credit affiliate with the sale
}
?>

ivytony
01-24-2008, 04:13 PM
oh, I think you misunderstood me. :(

What I want to do is: allow members (registered user on my website) to shop through my affiliate link (I am an affiliate of many many merchants). In this way, I get commissions from the merchant, right? Then a small portion of my commission (say 5%) will be allocated to my member who shops through my affiliate link. This is a way people visit your website and make purchases through your affiliate link.

So, the question I asked in the first post is: how do I track if a member actually makes a purchase?

Thanks a lot!!

dollar
01-24-2008, 04:38 PM
Ah I did misunderstand you, sorry about that.

Tracking something like that would really be difficult to do via an automated process. If you don't mind doing some work by hand one thing you could try is having the user fill out a form on the website when they make a purchase. You then check your affiliate account with whatever supplier they said they purchased from and ensure they really did make the purchase.

Asking a few details such as the items purchased and the total amount should keep out any fraud or similar from happening. Once you verify it was indeed them you could process their payment by hand.