Post by lpccoder » Thu Oct 18, 2012 5:17 pm

After read about Affiliate Program on Opencart I can tell this:
Comission are only based on a cookie tracking value.
For example, let suposse there are two affiliates Affiliate1 and Affiliate2 that have tracking1 and tracking2 codes.
If Affiliate1 send a customer to our Opencart the tracking1 code is set in a tracking cookie for 1000 days.
If some days (less than 1000) after Affiliate2 send the same customer to our Opencart using the tracking2 code, the tracking1 code is not removed. I mean that if the customer makes a purchase the comission goes to Affiliate1.
In this 1000 days any purchase made from this customer generates a comission to Affiliate1 unless customer deletes his cookies.
Is a "Who beats the first beats the best" situation that is not common in Affiliate Programs. In my opinion this should be changed.

Newbie

Posts

Joined
Fri Mar 12, 2010 5:06 pm

Post by lpccoder » Tue Oct 23, 2012 4:36 pm

I changed the index.php file to achieve this

Code: Select all

// LPCCODER Mod - Change days to 360 and last affiliate get the comision
/*
if (isset($request->get['tracking']) && !isset($request->cookie['tracking'])) {
	setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');
}
*/
if (isset($request->get['tracking'])) {
	setcookie('tracking', '', 1); // Deletes the cookie
	setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 360, '/');
}
// END LPCCODER Mod
I'm not an OpenCart expert but I think this should work as expected, I mean, that the last affiliate link get the comission over a year.

Newbie

Posts

Joined
Fri Mar 12, 2010 5:06 pm

Post by beavo » Tue Jan 01, 2013 8:22 pm

Has anybody tried this change? Did it work as expected?

Newbie

Posts

Joined
Sat Aug 11, 2012 1:52 am

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by al3xandr1a » Wed Jun 12, 2013 7:35 pm

Will this work with version 1.5.4.1?

~al3xandr1a
Newbie / Student


User avatar
New member

Posts

Joined
Fri Jul 02, 2010 7:27 pm

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by al3xandr1a » Mon Jun 17, 2013 12:26 am

With the recommended code change above, what happens if the customer visited the site the next day without using the affiliate link given to him by the affiliate? Say, the customer goes direct to page using the naked URL, will the new code delete his cookie yesterday? ---which would mean the affiliate wont get commission.

Please let me know your thoughts on this... Thank you.

~al3xandr1a
Newbie / Student


User avatar
New member

Posts

Joined
Fri Jul 02, 2010 7:27 pm

Post by ocmta » Mon Jun 17, 2013 1:08 am

al3xandr1a wrote:Say, the customer goes direct to page using the naked URL, will the new code delete his cookie yesterday?
No, it won't delete the cookie, affiliate will still get the commission.

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 myshadowself » Mon Aug 05, 2013 9:44 pm

Oh - this code example implements the Affiliate Industry standard of "Last Click" AKA "First past the post" attribution that every affiliate network worldwide used until recently when "Multi Affiliate Attribution" was standardised (still only a small percentage use that) .

I'm sure Daniel states that this is wrong here: http://code.google.com/p/opencart/issues/detail?id=414

And it must be wrong, because Daniel says it is wrong and everyone else does it the way Daniel says is wrong, so it must be wrong because it is not Daniel's way.

So it goes against all the "Open" in "OpenCart" to use the above code, as it is clearly wrong and you are wrong and so are you. Don't you dare use that wrong code.

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

Post by ocmta » Mon Aug 05, 2013 10:00 pm

Since 1.5.5 openCart does it this way, no modification required

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 Tee15 » Sat Dec 12, 2015 12:28 am

Hello,

I have a question as I'm working on the same situation. I searched thru my code and found this in my template version:

// Affiliate
$registry->set('affiliate', new Affiliate($registry));

if (isset($request->get['tracking'])) {
setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 1000, '/');


Since that was already in there i just changed the 1000 to 60 for sixty days like this

// Affiliate
$registry->set('affiliate', new Affiliate($registry));

if (isset($request->get['tracking'])) {
setcookie('tracking', $request->get['tracking'], time() + 3600 * 24 * 60, '/');


I'm just wondering, to achieve only a 60 day cookie, would that be all I need to do since my version already had the initial coding? Or would I still need to add all of the code previously mentioned in this thread above?

Thankful for any advice.

Newbie

Posts

Joined
Sat Jun 13, 2015 12:50 am
Who is online

Users browsing this forum: No registered users and 27 guests