Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm looking into building a referral link system for my website which I can track. What I want is to give this link for someone to add it to their website. When someone clicks on that link and uses my services, I want to be able to see for instance that it came from the guy who had that specific link on his website. That way I can see exactly which of my affiliates are sending me clients.

What I am thinking is this. Should I make like a database to store this information or something? I'm just looking for someone to maybe take some time and point me in the right direction?

It's probably going to have to do a check on the index page to see which URL it came from? I don't know. This cannot be this hard can it?

Anxiously awaiting a reply

Regards,
Christopher
Posted

Referral links usually work with a referral ID, like:

http://www.yoursite.com/ref.php?refid=0892379

In your web page, you read this refid and you can tell what referrer the link came from. You log this information to your database, then redirect the user to another web-page that you want them to land on. You can do this to a generic page (your website home page) or even put the user on different sections of your site based on referral ID.
 
Share this answer
 
Comments
Christopher Smit 10-Sep-13 12:54pm    
I understand this. But won't I also need to track the IP of the client? Because once I know that said client came from one of my affiliates and that client uses my services I will need to give the affiliate commission. How do I see that the refid and the client IP should go together?
Ron Beyer 10-Sep-13 13:10pm    
They don't, you can try to match the place that the request came from to the referrer ID to weed out people using the same ID on multiple servers, but I would do this according to domain name and not IP address since the IP address is subject to change, especially in a load sharing or shared hosting system (multiple domains for the same IP).
Christopher Smit 10-Sep-13 13:20pm    
I'm sure you have heard of commission junction. Let's say you have a business and I'm an affiliate of yours, and your website link is on my website. When someone clicks on that link it goes to your website and that person's IP or SOMETHING is stored somewhere so that you can see that it came from me #1. and #2. who the client is. Some of those sites store cookies for 60days to give the affiliate a 60 day window in which the client must use their services. Do you understand the way this works? and if you do can you maybe explain how they do this? Thank you for your time so far though! +1
Ron Beyer 10-Sep-13 13:26pm    
The only way I know of to know a link came from a referrer is what I referenced in my answer. You could also use something like this answer to check where the link is coming from (domain) and check it against a database of valid referrers. You could also use time-outs in your database (so that the referrer doesn't have to have a "cookie") so that if you don't get referral links in some time period then the activity is not logged.
You can also use Cookies to identify users. Below is the explanation with more details.

E.g. I want to track how many actual users transferred to my site by clicking below link.
https://tispy.net/TiSPY/index.jsp?refid=codeproject

Here landing page is index.jsp but I want to check how many users made payment or accessed payment page from above link. I can check it by setting refid to its browser cookie.

Once I sent it in browser cookie, all requests (Even after user close browser or reboot computer) you will get the cookie when that user access payment page. Now if I want to set commission for code project on my each new payments for me it is very simple to manage.

Limitation : If user access the site from different browser while making payment, it will not possible to manage stuff.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900