Setup of tracking code for Gambio

If you use Gambio on your site, you can follow the guide below to install our tracking code in your webshop.

 

1. Log in to the admin console and go to Settings, then Tracking Codes. Select Open.

 

2. In the section Tracking Code (Head) you will find the Tracking Code field. Insert the following code snippet there:

<script async src='https://addrevenue.io/track.js'></script>

 

3. In the section Tracking Code (Body checkout success page) you will find the Tracking Code field. Insert the following code snippet there:

<script src="https://addrevenue.io/track.js"></script>
<script>
var subtotal = {if $order->getOrderTotals()|count > 2}{$order->getOrderTotals()->getItem(2)->getValue()}{else}{$order->getOrderTotals()->getItem(0)->getValue()}{/if};

var items = [
	{foreach from=$order->getOrderItems() item=item name=products} {
		item_id: '{$item->getProductModel()|escape:"javascript"}',
		item_name: '{$item->getName()|escape:"javascript"}',
		price: {$item->getFinalPrice()},
		quantity: {$item->getQuantity()}
	}{if not $smarty.foreach.products.last},{/if}
	{/foreach}
];

ADDREVENUE.sendEvent('Purchase', {
	value: subtotal,
	currency: 'EUR',
	orderId: '{$order->getOrderId()}',
	discountCodes: '',
	products: items
});
</script>

 

4. Save the changes. Done.

 

Back