Page 1 of 1

How to make affiliate referral period only last per session?

Posted: Tue Apr 28, 2009 11:39 pm
by bemara579
I notice admin panel, the affiliate edit page has a "Referral Period" in days. Is there any way to make it so that the referral period only lasts as long as the user's visit?

For example, a user comes to my store with an affiliate url parameter. The user is associated with that affiliate as long as the user stays in the store. Once the user leaves the store, their affiliate referral period gets forcefully expired. Any ideas on how to achieve this?

Re: How to make affiliate referral period only last per session?

Posted: Fri May 01, 2009 8:41 am
by Logan Rhodehamel
You would need to customize in a handful of places, maybe an intermediate task?

1) use a session start hander in the global.asax, on session start look for an affiliate id in the url. If you find it, set a session variable. Make sure to set User.AffiliateId to 0 and save the user.

2) customize one page checkout in the ConLib folder. In the "checkingout" handler, look at your session variable and set the user affiliate ID if you find it. In the "checkedout" handler, clear the user affiliate ID again.

I think something along these lines would work. Once the user session expires, the affiliate ID association would be gone.