AffilBox implementation in Magento
Today we have for you a tutorial on how to implement AffilBox into the popular opensource eshop system Magento.
Before deploying the codes, create a subdomain for your commission program.
This will give you both a tracking and conversion code in the shape of your domain, and you will have a higher order tracking success rate.
Implementation of tracking code
The tracking code tracks incoming visitors and stores a cookie to later identify and match them to the partner that brought them in.
The tracking code looks something like this:
var affilate = ‘http://demo.affilbox.cz/’;
var advertiser = 1;
var campaign = 1;
The specific code for your campaign can be found in AffilBox in the left menu – Campaigns:
Expand your campaign and select Codes from the top menu:
Place this code in the header or footer template of your store.
Implementation of conversion code
In the same place you will find the conversion code in AffilBox, it takes care of recording the conversion and its value.
Place the following code in /app/design/frontend/default/template/checkout/success.phtml.
Place this line:
<!–?php $lastOrderId = Mage::getSingleton(‘checkout/session’)—>
$order = Mage::getSingleton(‘sales/order’); $order->load($lastOrderId);
$_totalData = $order->getData(); $_grand = $_totalData[‘subtotal’];
$_subtotal = number_format($_grand, 0); ?
And place this code underneath (modify according to your domain and campaign).
<?php echo $_subtotal;?>/transactions/<?php echo $this->getOrderId()?>/”
height=”1″ width=”1″ frameborder=”0″ scrolling=”no”></iframe>
And that’s it!
If you need help with anything, feel free to contact us anytime and we’ll be happy to help and advise you.