How to set a referrer?

Hi, I want to allow my web user to select referrer. I get the affiliate_id through PHP when user select in webpage, but how to use that affiliate_id to set the session’s referrer?

Many thanks,
Leon

3 Responses to How to set a referrer?

  1. Liang December 6, 2015 at 6:48 pm #

    Never mind. I found the solution. It’s due to the MD5 encoding. Instead of sending the affiliate_id, I send the md5(affiliate_id). That works.

    Thanks,
    Leon

  2. Liang December 6, 2015 at 4:29 pm #

    Thank you so much for the prompt response, George,

    I set the wp_affiliates cookie to one of the affiliate_id (for example, 2), but then when I use [referrer_id] shortcode to see if the referrer has been set, it returns nothing. It doesn’t seem to work. Would you please talk about more details?

    Best regards,
    Leon

  3. George December 5, 2015 at 9:30 am #

    Hi Liang,

    You set an affiliate coupon for each affiliate, share these coupons and therefore allow the user to
    choose the desired affiliate.
    If you don’t use an e-commerce solution, you can do the same with affiliates links.

    However, if these solutions don’t fit you, you can use PHP’s setcookie() for the wp_affiliates cookie.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share