Jump to content
Sign in to follow this  
Farrukh

[CONTRIBUTION] Affiliate Program - Sales Tracking

Recommended Posts

HIya all

 

I have joined Shareasale and Darkblue recently and i was looking for a way to include the Affiliate Tracking Code into the Confirmation page.

 

So i created a small contirbution for this very purpose.

 

You can check the contribution here:

 

http://www.oscommerce.com/community/contributions,1249

 

 

Got most of the help from Henri Schmidhuber

Share this post


Link to post
Share on other sites

I am having a huge problem with shareasale - one, it's taking the 10% for commission and it's taking 10% of the shipping costs too. It should take 10% from the subtotal, not the full total.

 

Also, it won't track pay pal - I'm not a technical person and have no idea how to fix this but it's driving me mental!!

Share this post


Link to post
Share on other sites

I was able to install this contrib and the sub-total seems to work but the order_id is wrong.

 

In my case it was supposed to be 55 but the tracking is 112.

 

I figured out the fix. Just change the contrib code from

 

$orders_id=$order_products_id;

 

to

 

$orders_id=$insert_id;

 

Thanks for the contrib!

Share this post


Link to post
Share on other sites
I am having a huge problem with shareasale - one, it's taking the 10% for commission and it's taking 10% of the shipping costs too. It should take 10% from the subtotal, not the full total.

 

Also, it won't track pay pal - I'm not a technical person and have no idea how to fix this but it's driving me mental!!

When you insert the shareasale pixel, you need to pass over the sub-total. Do not pass the Grand Total or it will take 10% of the grand total. That includes shipping and taxes.

Share this post


Link to post
Share on other sites
HIya all

 

I have joined Shareasale and Darkblue recently and i was looking for a way to include the Affiliate Tracking Code into the Confirmation page.

 

So i created a small contirbution for this very purpose.

 

You can check the contribution here:

 

http://www.oscommerce.com/community/contributions,1249

 

 

Got most of the help from Henri Schmidhuber

I'm having a problem with dual affiliate systems:

 

If a visitor has come from a Shareasale affiliate then bought something, Shareasale gets credit.

 

Then if the same visitor comes from DarkBlue later on, BOTH Darkblue and Shareasale gets credit.

 

That's because you have both pixels showing. I need to figure out how to prevent the original pixel from showing once the same visitor comes back from the other affiliates.

 

Basically change the code to:

 

If the referrer is shareasale, only show the shareasale pixel

If the referrer is Darkblue, only show the darkblue pixel.

Share this post


Link to post
Share on other sites

Try this code

 

 

1).Find This Line in catalog/checkout_process.php

 

// load the after_process function from the payment modules
 $payment_modules->after_process();

 $cart->reset(true);
 
 
Add Above it:
 
// Begin Affiliate Program - Sales Tracking
$orders_total=$currencies->format($order->info['subtotal']); 
tep_session_register('orders_total'); 
$orders_id=$insert_id; 
tep_session_register('orders_id'); 
// End Affiliate Program - Sales Tracking

 

 

2).Find This Line in catalog/checkout_success.php

 

<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
         </tr>
       </table></td>
     </tr>
     
Add After it:
     
// Start Affiliate Program - Sales Tracking

<?php 
// Start Affiliate 

echo '<a src="https://shareasale.com/sale.cfm?amount=' . $currencies->format($order->info['subtotal']) .'&tracking='.$orders_id.'&transtype=sale&persale=&perlead=&perhit=&merchantID=3735" width=1 height=1">'; 
tep_session_unregister('orders_total'); 
tep_session_unregister('orders_id'); 
// End Affiliate 
?>     

// End Affiliate Program - Sales Tracking

 

 

Reply to the thread if the above solution works.

its for Sub Totaal

Edited by Farrukh

Share this post


Link to post
Share on other sites

I am trying to get this contribution to work on MS2 for darkblue. But it is not working. Anyone have directions on how to get MS2 to work with darkblue?

Share this post


Link to post
Share on other sites
I am trying to get this contribution to work on MS2 for darkblue.  But it is not working.  Anyone have directions on how to get MS2 to work with darkblue?

 

I used the code that was added back in Oct 16 by Farrukh. But, it didn't want to work. I modified the code in the catalog/checkout_success.php file to this and things are working. But, you must of course change <your_id_number_here> .

 

<?php
/* Start Affiliate Program - Sales Tracking
$merchantID = '<your_id_number_here>';
<img src="https://shareasale.com/sale.cfm?amount=AMOUNTOFSALE&tracking=TRACKINGNUMBER&transtype=TYPEOFTRANSACTION&merchantID=6805" width="1" height="1">
*/
echo '<img src="https://shareasale.com/sale.cfm?amount=' . strip_tags($order_total['value']) .'&tracking=' . $orders_id . '&transtype=sale&merchantID='. $merchantID .'" width=1 height=1">';
tep_session_unregister('orders_total');
tep_session_unregister('orders_id');
// End Affiliate Program - Sales Tracking
?>    

 

Paul

Share this post


Link to post
Share on other sites

Oops. I got a bit messed up on my last post sorry. I think this is a bit better. And I do think that this will work with PayPal. But, I have yet to test that. I have just tested it with check/moneyorder .

 

I used the code that was added back in Oct 16 by Farrukh. But, it didn't want to work. I modified the code in the catalog/checkout_success.php file to this and things are working. But, you must of course change <your_id_number_here> .

 

<?php
// Start Affiliate Program - Sales Tracking
$merchantID = '<your_id_number_here>';

echo '<img src="https://shareasale.com/sale.cfm?amount=' . strip_tags($order_total['value']) .'&tracking=' . $orders_id . '&transtype=sale&merchantID='. $merchantID .'" width=1 height=1">';
tep_session_unregister('orders_total');
tep_session_unregister('orders_id');
// End Affiliate Program - Sales Tracking
?>    

 

Paul

Share this post


Link to post
Share on other sites

I've been unable to get ShareaSale to work along with the Paypal IPN payment module. This is partly because the user is taken off-site to process cards and then returned so the values are not passed to the sharasale source placed in checkout_success.php.

 

So, to work around this I am trying to add the shareasale code to the checkout_process.php page, but I noticed that it doesn't have any HTML that gets displayed so the pixel from shareasale never gets called. Where can I add this code to complete the sharasale tracking?

 

// Start Affiliate Program - Sales Tracking
<php
echo '<img src="https://shareasale.com/sale.cfm?amount='.$orders_total.'&tracking='.$orders_id.'&transtype=sale&persale=&perlead=&perhit=&merchantID=myID" width=1 height=1">';
tep_session_unregister('orders_total');
tep_session_unregister('orders_id');
?>
// End Affiliate Program - Sales Tracking

 

TIA

Share this post


Link to post
Share on other sites

Every man and his dog has tried to get SAS working with Pay Pal, there isn't a single merchant it tracks the actual amount with, it has to be added in manually in SAS.

Share this post


Link to post
Share on other sites

I can tell you that my dog hasn't worked on this yet. :D

 

I've been trying to figure out if there was a way to do this through cookies. Set the cookie then retrieve it before shareasale transaction completes. Whatdya think?

Share this post


Link to post
Share on other sites

I've implemented sales tracking with PayPal and I've just added this as a new contribution (not showing yet). If anyone wants the code before the contribution is available just PM me. It's a very simple mod to checkout_success.php only.

Share this post


Link to post
Share on other sites

Hi folks,

 

I have signed up with shareasale.com affiliate program, but was unable to implement the tracking code with MS2. I have written shareasale.com for my problem and what they advised me was to place this code into checkout_process.php:

 

// Begin Affiliate Program - Sales Tracking
$orders_total=$currencies->format($cart->show_total()- $total_tax); 
tep_session_register('orders_total'); 
$orders_id=$insert_id; 
tep_session_register('orders_id'); 
// End Affiliate Program - Sales Tracking

 

 

In the page: catalog/checkout_success.php, just below the line,

<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
add the following code: 
<!-- Start Affiliate Program - Sales Tracking -->
<?php
echo '<img
src="https://shareasale.com/sale.cfm?amount='.$orders_total.'&tracking='.$or
ders_id.'&transtype=sale&merchantID=XXXX" width="1" height="1">'; 
tep_session_unregister('orders_total'); 
tep_session_unregister('orders_id'); 
?> 
<!-- // End Affiliate Program - Sales Tracking -->

 

Where you replace XXXX with your merchant ID number.

 

However it didn?t work. I would like to know if anyone has implemented the code in order to work with osCommerce MS2 and 2checkout V2. I don?t know if there is a difference whether it is 2checkout, Paypal or any other payment processor, but I guess that it matters since the parameters 2checkout returns after a sale is generated are different from those with Paypal for example.

 

Anyone?!? :huh:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×