Post by skimottaret » Tue Sep 18, 2012 1:12 am

We have implemented several affiliates links and this is all working within our shop

does anyone know how opencart handles the situation if a customer had clicked on links from multiple affiliates before actually making a purchase?

say a user clicks though initially from affiliate 1 site doesnt buy but then returns a few weeks later from a link on affiliate 2 website and then concludes the transaction.

Which affiliate would be credited with the commission? The first, the most recent cookie or ??
Last edited by i2Paq on Sat Oct 06, 2012 8:20 pm, edited 1 time in total.
Reason: Title adjusted

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by Avvici » Wed Sep 19, 2012 4:27 am

Each URL that is tied to that particular purchase has an affiliate ID tied within it. A purchase is a purchase no matter where it comes from. During the order confirmation the code checks for a cookie that is set.

The url that is created for tracking would look something like this:

Code: Select all

'link' => str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $result['product_id'] . '&tracking=' . $this->affiliate->getCode()))
In the core of open cart there is ALWAYS a cookie being set as soon as a URL is sent to the core via $_GET.
Here is the code that makes the affiliates connecting UNIQUE (all of the time)

Code: Select all

if (isset($request->get['tracking']) && !isset($request->cookie['tracking'])) {
    setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');
}
No matter how many people connect and when....there is always an affiliate ID within a cookie, created by the index core (which is searching for a $_GET). You can send 100 connections to the Open Cart at the same time. There will be 100 individual cookies set that are tied to a particular AFFILIATE.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by skimottaret » Wed Sep 19, 2012 5:32 am

thanks avvici, I'm not a programmer but is there a rule for which cookie gets the priority?

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by SXGuy » Wed Sep 19, 2012 6:53 am

yes, the link that is used to checkout from.

If someone followed an affiliate link last week, looked at the item, didnt buy, left, closed the window, turned the computer off. A week later, follows a link from another affiliate, but actually buys the product.

Then obviously, the affilate who gets the comission, is the one whos link was used to purchase the item.

It would be a bit silly to continually track all affiliates linked to a product that has been viewed, since product inception.

And since no purchase was made on the first attempt, its only fair that they dont receive the commission.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by skimottaret » Wed Sep 19, 2012 4:09 pm

Thanks SXGuy, we have had this come up and need to let our affiliates know the "rules" and will advise that the most recent click through gets the commission.

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by Avvici » Thu Sep 20, 2012 2:13 am

skimottaret wrote:thanks avvici, I'm not a programmer but is there a rule for which cookie gets the priority?
As I explained, there really is no priority. It's based on the present link to checkout. O0

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by skimottaret » Thu Sep 20, 2012 2:41 am

interesting as during testing it looks as though if a customer clicks through from affiliate 1's link and makes a purchase THEN after loggin out and clicks through from affilate 2 link and makes a second purchase in another session affiliate 1 gets the commission in our opencart shop

New member

Posts

Joined
Wed Aug 24, 2011 9:21 pm

Post by SXGuy » Thu Sep 20, 2012 3:15 am

hmm, then that is a bug, if thats true for all carts. Maybe you should raise it in the bug thread.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Avvici » Thu Sep 20, 2012 4:07 am

skimottaret wrote:interesting as during testing it looks as though if a customer clicks through from affiliate 1's link and makes a purchase THEN after loggin out and clicks through from affilate 2 link and makes a second purchase in another session affiliate 1 gets the commission in our opencart shop
Huh? That makes 0 sense.....where is the second affiliate link? Send both URL's for the separate affiliate links.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by ocmta » Sat Oct 06, 2012 7:41 pm

skimottaret wrote:interesting as during testing it looks as though if a customer clicks through from affiliate 1's link and makes a purchase THEN after loggin out and clicks through from affilate 2 link and makes a second purchase in another session affiliate 1 gets the commission in our opencart shop
This is true, and also even a user's first visit was via affilaite 1's link, but he didn't buy anything, and then later visits and buy via affiliate 2's link, still only affiliate 1 gets the commission.

Affiliate 1's tracking code cookie will stay saved in cookies for 1000 days, and won't be replaced by any other affiliate's tracking code no matter what (unless the user clears cookies, of course).

This actually makes some sense, and many affiliate programs work that way, because 2nd, 3rd etc. affiliates direct the user to a site he knows already, while the 1st affiliate was the one who "showed" this site to the user, and deserves more credit. This is controversial, though.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by Avvici » Sat Oct 06, 2012 9:33 pm

ocmta wrote:
skimottaret wrote:interesting as during testing it looks as though if a customer clicks through from affiliate 1's link and makes a purchase THEN after loggin out and clicks through from affilate 2 link and makes a second purchase in another session affiliate 1 gets the commission in our opencart shop
This is true, and also even a user's first visit was via affilaite 1's link, but he didn't buy anything, and then later visits and buy via affiliate 2's link, still only affiliate 1 gets the commission.

Affiliate 1's tracking code cookie will stay saved in cookies for 1000 days, and won't be replaced by any other affiliate's tracking code no matter what (unless the user clears cookies, of course).

This actually makes some sense, and many affiliate programs work that way, because 2nd, 3rd etc. affiliates direct the user to a site he knows already, while the 1st affiliate was the one who "showed" this site to the user, and deserves more credit. This is controversial, though.
No, this is not true. It should not work that way. Like was mentioned above if that is happening then it is a bug. I need to set something up to try it for myself, to echo out the actual sessions.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by ocmta » Sat Oct 06, 2012 9:42 pm

Maybe it's not correct behavior, that is arguable, however this is how it works. Look at the code you've posted yourself

Code: Select all

if (isset($request->get['tracking']) && !isset($request->cookie['tracking'])) {
    setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');
}
It basically translates to - that if there is tracking code present in the URL AND there is NO tracking cookie set yet, only then set the tracking cookie for 1000 days. Therefore no tracking code in the URL can replace already existing tracking cookie.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by Avvici » Sat Oct 06, 2012 10:01 pm

Well yeah, that is what I said. We are talking about two different things. The point is....the system may not be working like it should and needs testing.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC
Who is online

Users browsing this forum: No registered users and 100 guests