What I would like to do is track if a user has been referred to my website. If the incoming user purchases something I would like to share revenue with the affiliate. I'm not sure what the common ways people do this.

I can put a new user form on the affiliate website and then track each new user that form creates.

This creates a problem of people who don't create a new user account but come to the website through a link. How do I manage this?


1 Answer 1


There are two ways you can do this:

The more common way to do it would be to give your affiliate a special url to use in their links, such as mysite.com/referal.php?a=4912380312957893412, and then use google analytics to track visitors who have visited that url (with the a=4912380312957893412 at the end). See this google analytics page on custom campaigns for instructions on how to do this in google analytics (they'll want you to use different url parameters, though).

The other way you could do this would be to count all visits from one domain as affiliate links. This isn't as accurate, for two reasons. This depends on users sending a referral header, and in some browsers this is disabled. Also, this would also count links from that site that your affiliate might not have anything to do with, e.g. someone posts a comment on that site with a link to your site.

You can then track your affiliate links in google analytics under traffic sources. I'm assuming that your using google analytics, because your question is tagged with that tag, but if you aren't, then let me know in the comments and I will edit this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.