Once you register the user, you provide him with a link to certain page with specific code or the username.
http://mysite.com/index.php?referrer=johnsmith
Once the user visits, if this referrer variable is set, register it in the session.
if (IsSet($referrer))
{
session_register('referrer');
$_SESSION['referrer'] = $referrer;
}
This user might browse the website for some time, referrer information will not be lost and when he decides to register (or whatever action you are looking for) this code will be retrieved from session and used to increment counter in user database details, showing how many people has be brought. If you need to keep track which people exactly have been attracted by a certain referrer, you might have another field in user database - referrer (means this user was brought by $userid_of_referrer).
I hope I was clear.
Contact me on my e-mail if you need help.
2007-02-20 02:11:31
·
answer #1
·
answered by p.mihova 2
·
0⤊
0⤋
The best (and most fair) way to do this will be via cookies. Yes, provide your affiliates with an ID that will be pulled out of the URL via the $_GET[] array. However, you should then decide how many days a site visitor has to become a client or customer, and save that variable in a cookie that expires after that many days. Then, if a sale is not generated on the very FIRST site visit, the visitor might bookmark any page on your site, and the cookie will still be there when they come back... assuming that you've got the PHP code that reads/writes the cookie at the top of every page (in your header, perhaps).
So, in a nutshell, the affiliate function in your header would...
1) Check to see if an affiliate ID exists in the cookie, and read that.
2) Check to see if an affiliate ID exists in the URL, and read that.
At this point you have a decision to make. If a cookie AND a URL ID exist, then which one takes precedence if they are not the same? In other words, the visitor followed two different affiliate links in at different times. Who gets the sale?
3) Write the cookie back, so that the expiration date/time gets updated.
Finally, you'll want your transaction processing or user registration to read that cookie and do what needs to be done with the ID.
A thought on sessions: You COULD use a session variable here instead of a cookie, IF you want the affiliate ID to be valid for the current session ONLY. Most affiliate programs allow proper credit if the visitor returns, from 7 to 30 days.
Additional Features: You might also want to consider adding at least two features to your affiliate referral system....
1) A reporting system, where affiliates can log in and see how many hits they got, per day, per month, however you want to set it up.
2) An additional variable besides the ID that the affiliate can add to the URL. Let's call it CAMPAIGN. That variable can be alphanumeric, and contain any type of code the affiliate should desire. Then have a report that summarizes the site hits sorted by campaign. This will let your top sellers gauge which of their strategies are most effective (email, web discussion groups, classified ads, etc).
2007-02-20 10:41:37
·
answer #2
·
answered by Anonymous
·
2⤊
0⤋
While sending the link, you have added refrelno="bla-bla-bla". You should store this refrelno in your database and with this attach the user id who is sending this invitation. When the referred person registers with the site, just get refrelno from his query string and find the user-id who had sent this refrelno. And give money to that user according your your system's criteria.
2007-02-20 17:21:43
·
answer #3
·
answered by Atif Majid 3
·
0⤊
0⤋
well u can..
the only logic behind this...
when a user registers in ur site.while storing his information in your database generate and store a random text or number (and increment that each time another user registers).Then show that text or number to the user...
now when the user clicks on the link u can update the database and do ur logic.
sounds counfusing???
well mail me on sashank@jamesbond.in for more detailed answer
Thanks
A.Sashank
2007-02-20 00:57:25
·
answer #4
·
answered by sashank_1234 2
·
0⤊
2⤋