Beslist tracking code

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Beslist tracking code

Postby mkwaad@.....com » Sat Aug 09, 2014 11:52 pm

Hello,

We are struggling to implement the beslist tracking code:
The following standard code is delivered by beslist.

var beslistQueue = [];
beslistQueue.push(['setShopId', 'AABBCCDDEE']);
beslistQueue.push(['cps', 'setTestmode', false]);
beslistQueue.push(['cps', 'setTransactionId', 'AB12345']);
beslistQueue.push(['cps', 'setOrdersum', 1155.94]);
beslistQueue.push(['cps', 'setOrderCosts', 6.95]);
beslistQueue.push(['cps', 'setOrderProducts', [
['UE46H7000', 1, 1099.00],
['FSB07B', 1, 49.99]
]])
;
beslistQueue.push(['cps', 'trackSale']);
(function () {
var ba = document.createElement('script');
ba.async = true;
ba.src = '//pt1.beslist.nl/pt.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ba, s);
})();


Fields to be changed:
setShopId == our shopid of beslist
setTestmode == running test mode or not (true/false)
setTransactionId == order#
setOrdersum == total order amount
setOrderCosts == order costs
setOrderProducts == unique code, pieces, price per product

Hopefully someone can help me out with the information we need to fill into the tracking code.

Thank you
mkwaad@.....com
 
Posts: 5
Joined: Wed Feb 15, 2012 1:16 pm

Re: Beslist tracking code

Postby admin » Tue Aug 12, 2014 3:32 pm

hello marc, the beslist tracking code is already implemented in:

\components\com_onepage\trackers\php\beslist_nl.php

with opc tracking you can configure an order status for which the code should get shown. This code uses the image method to track the purchase and hostname as the indentification:

Code: Select all

defined( '_JEXEC' ) or die( 'Restricted access' );
$order_total = $this->order['details']['BT']->order_total;
$oc =  (int)(((float)$this->order['details']['BT']->order_shipment )*100);
$os = (int)($order_total * 100);


$pl = '';
foreach ($this->order['items'] as $key=>$order_item) {
$price = (int)($order_item->product_final_price * 100);
if (!empty($pl)) $pl .= ';';
$pl .= $order_item->order_item_sku.':'.$order_item->product_quantity.':'.$price;
}
$pl = $this->escapeSingle($pl);


// \x70\x32\x2E\x62\x65\x73\x6C\x69\x73\x74\x2E\x6E\x6C  translates to: p2.beslist.nl
// \x77\x77\x77\x2E\x62\x65\x73\x6C\x69\x73\x74\x2E\x6E\x6C traslates to: www.beslist.nl

// pl: items
// os: order total
// ti: order_id
// oc: order shipping
// test is always 0
// ident is the hostname per configuration

?>

<script>
var _v = _v || [];
_v.push(
['ti', '<?php echo $this->order['details']['BT']->virtuemart_order_id; ?>'],
['os', '<?php echo $os; ?>'],
['pl', '<?php echo $pl; ?>'],
['oc', '<?php echo $oc; ?>'],
['ident', '<?php echo $this->params->hostname; ?>'],
['test', '0']
);
var _a = "/pot/?v=2.1&p=" + encodeURIComponent(_v) + "&_=" + (Math.random() + "" * 10000000000000),
_p = ('https:' == document.location.protocol ? 'https://' : 'http://'),
_i = new Image;
_i.onerror = function(e) { _i.src = _p+"\x70\x32\x2E\x62\x65\x73\x6C\x69\x73\x74\x2E\x6E\x6C"+_a; _i = false; };
_i.src = _p+"\x77\x77\x77\x2E\x62\x65\x73\x6C\x69\x73\x74\x2E\x6E\x6C"+_a;
</script>



If you'd like i can add your javascript code for the tracking as well.

Best Regards, Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Beslist tracking code

Postby admin » Tue Aug 12, 2014 3:51 pm

I just included your code there as well and i am also working on the XML export function for beslist at the moment. i can send you an update later on.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Beslist tracking code

Postby mkwaad@.....com » Wed Aug 13, 2014 1:08 am

HI Stan,

Thank you for your reply. How can I test the script?
Beslist needs 20 test orders to test the tracking code.

Thank you
mkwaad@.....com
 
Posts: 5
Joined: Wed Feb 15, 2012 1:16 pm

Re: Beslist tracking code

Postby admin » Fri Aug 15, 2014 10:31 am

hello marc, let me know about the update i've sent you, so i can release it. it also has a nice xml export for beslist.
best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2