Consider the following situation:

A web surfer clicks on affiliate #1's link and the cookies are set with affiliate #1's uid.

A few days go by and the Web surfer clicks on affiliate #2's link. The uid in the cookie is updated to the uid of the most recent affiliate.

Perhaps I just don't understand or there is a setting or configuration I'm not aware of to accomplish this?

From my testing it appears once the cookie is set it is not reset until the cookies are deleted or time out. Even if a link of a different affiliate is clicked.

In essence I would like to update the cookies every time an affiliate link is clicked.

It seems like this would be a desired configuration so I'm thinking I'm just missing something?

Comments

bojanz’s picture

There's no desired configuration. It was specifically made so that clicking another affiliate link doesn't change the cookie.

zeryn’s picture

OK. I'm just coming up to speed on the different types of affiliate options.

If more than one affiliate sends the same person to your site there are a few options for determining who gets the credit.

1- The credit for the sale goes to the first affiliate that sent someone to the site.
2- The credit goes to the most recent affiliate that sent someone to the site.
3- The credit is shared in some way by all those that sent someone to the site.

Any of these options could make sense. Our affiliates would like option 2.

Since this is not a desired configuration for your module I looked into modifying it for our needs and wondered if you see any "gotchas" by making the following change.

The function _uc_affiliate2_clicked currently contains the following code to only set the cookies if they haven't been set before:

  // Do we already have an affiliate in session? Do nothing
  if($_SESSION['affiliate']) {
    return TRUE;
  }

This could be modified to only set the cookies if they are different:

  // Do we already have the same affiliate in session? Do nothing
  if($_SESSION['affiliate'] == $account->uid) {
    return TRUE;
  }

It seems like this would update the cookies and the session variable as well. Each affiliate would still see the clicks they received.

Since your module is based on a single affiliate getting credit I wonder if this will cause some unforeseen grief in the reporting or elsewhere? Thanks for your outstanding module and time.

bojanz’s picture

Status: Active » Closed (works as designed)

Shouldn't cause you any problems.

Marking this as "by design", since there are no changes to be made to uc_affiliate2.

AlanT’s picture

Category: support » feature
Status: Closed (works as designed) » Active

This should be reopened and changed to a "feature request".

There are many of us who WANT to give credit to the most recent affiliate referral, and forcing everyone to use only 1 style of affiliate management is, in my opinion, not the Drupal way.

bojanz’s picture

Okay, I agree. Patches welcome.

ob3ron’s picture

Subscribing as I'm also very interested in this. I'll see if I can make a patch, if I find the time before someone else does. :)

There is also a fourth option to the three that zeryn posted:

1- The credit for the sale goes to the first affiliate that sent someone to the site.
2- The credit goes to the most recent affiliate that sent someone to the site.
3- The credit is shared in some way by all those that sent someone to the site.

4- The credit goes to the most recent affiliate that referred someone to the site before a purchase is made, and that affiliate is then given permanent credit for any future sales.

#4 is actually what I would like to implement, so the person that makes the sale gets credit for future sales as well, even if other people refer that visitor to the site before or after the sale.