News:

Looking for documentation? Take a look on our wiki

Main Menu

Conversion tracking code installation (clickbanner.gr)

Started by atpascal, February 04, 2014, 17:58:00 PM

Previous topic - Next topic

atpascal

Hi,

I have an installation of J 2.5.4 and VM 2.0.6

I need to put affiliate tracking code to track sales at clickbanner.gr affiliate network.

They told me to put the code at thankyou page. I've read in this forum that I should put the code at  order_done.php. I did but sales not tracked.

Notice that the only payment method I have is Paypal.


There are two sets of code. The one they provided me and the second with the table and field changes I made.

1. clickbanner.gr code:
<?php
$q = "SELECT * FROM #__{vm}_user_info WHERE user_id='$user_id'";
$db->query( $q );
$user_email = $db->f('user_email');

$q = "SELECT * FROM #__{vm}_orders WHERE order_id='$order_id'";
$db->query( $q );
$order_subtotal = $db->f('order_subtotal' );
$coupon_code = $db->f("coupon_code");
$coupon_discount = $db->f("coupon_discount");
if (!is_null($coupon_discount) && $coupon_discount != '') {
   $order_total =  $order_subtotal - $coupon_discount;
} else {
   $order_total =  $order_subtotal;
}

$q = "SELECT * FROM #__{vm}_order_item WHERE order_id='$order_id'";
$db->query( $q );
$product_id = $db->f('product_id');
?>

<img src="http://network.clickbanner.gr/i_track_sale/10839/<?php echo $order_total;  ?>/<?php echo $order_id; ?>/OPTIONAL_INFORMATION&sale_status=P">


2. Updated code
<?php /*conversion tracking code integration */
$q = "SELECT * FROM jos_virtuemart_order_userinfos WHERE virtuemart_user_id='$user_id'";
$db->query( $q );
$user_email = $db->f('email');

$q = "SELECT * FROM jos_virtuemart_orders WHERE order_number='$order_id'";

$db->query( $q );
$order_subtotal = $db->f('order_subtotal' );
$coupon_code = $db->f("coupon_code");
$coupon_discount = $db->f("coupon_discount");
if (!is_null($coupon_discount) && $coupon_discount != '') {
   $order_total =  $order_subtotal - $coupon_discount;
} else {
   $order_total =  $order_subtotal;
}

$q = "SELECT * FROM jos_virtuemart_order_items WHERE order_number='$order_id'";
$db->query( $q );
$product_id = $db->f('virtuemart_product_id');
?>

<img src="http://network.clickbanner.gr/i_track_sale/10839/<?php echo $order_total;  ?>/<?php echo $order_id; ?>/OPTIONAL_INFORMATION&sale_status=P">


Can anyone please help?

Thank's in advance,
Pascal