Download & Extend

Affiliate link / Rferral ID via GET

Project:User Referral
Version:6.x-1.x-dev
Component:Code: referral
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi,

How to set the cookie on every page, when ?referral=877548484 is added to the url?
I use url-rewriting for nice seo-urls, I want something like this to work:

http://www.yourdomain.com/productxx?referral=877548484

I don´t use an affiliate-module, because User Referral is everything I want except this.

Comments

#1

Title:Affiliate link» Affiliate link / Rferral ID via GET
Version:5.x-1.0» 6.x-1.x-dev

need the same - I have set up something like

$refrid = $_GET['rid'];
$uid = _referral_ref2uid($refrid);

inside the referral_get() function but ints not working - maybe some cache issue?

#2

I got the solution

Just needed to create a custom block which checks if there is set a RID (Referral ID) and sets the cookie.

<?php

$refrid
= $_GET['rid'];
   
if (
$refrid){   
 
$uid = _referral_ref2uid($refrid);   
 
referral_set_cookie($uid);
}

?>

#3

Would this solution (the custom block) work when drupal cache is enabled? I don't think so, but on your site, do you have cache enabled?

nobody click here