Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to let my clients earn some commission if someone clicks through from their website to mine AND later converts into a new customer. I don't seem to find any WordPress affiliate plugins that do this nicely.

The idea is to have an ID attached to the end of my link on their site. I can capture that ID on the landing page, but the problem is to carry that ID through as they click around my site (sessions? in the URL?), and then if they fill in the contact form, to add it as a hidden field.

I will then have that ID in the enquiry email I receive and if that person becomes a new customer I can easily see who the referring client was.

Whats the best way to do this?

share|improve this question
3  
I'm not sure that this question is in any way specific to WordPress? – Chip Bennett Feb 2 '12 at 20:40

closed as off topic by kaiser, EAMann Feb 3 '12 at 17:06

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

Try storing the Affiliate ID in a cookie.

To claim the id try

$affiliate_id = $_POST['affiliate_id'];
setcookie('affiliate_id', $affiliate_id);

You should be able to do the following in your form code.:

if(isset($_COOKIE['affiliate_id']{
    //pay commission.
} else {
    //no commission for you
}
share|improve this answer
Thanks for answering Joshua, I'll give that a try :) – Mark Theron Feb 3 '12 at 9:19
If it works are you able to accept the answer please? – Joshua Feb 3 '12 at 20:26

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