Tag Archives: perfect audience

Perfect Audience Magento Integration Code

<script type=”text/javascript”>
(function() {
window._pa = window._pa || {};
if(document.location.href.

indexOf(‘checkout/onepage/success’) != -1) {
<?php
$_tmp_amount = 0.00;
$lastOrderId = Mage::getSingleton(‘checkout/session’)
->getLastRealOrderId();
if($lastOrderId) {
$_tmp_amount = Mage::getModel(‘sales/order’)
->loadByIncrementId($lastOrderId)
->getBaseGrandTotal();
}
?>_pa.orderId = “<?php echo $lastOrderId; ?>”;
_pa.revenue = “<?php echo $_tmp_amount; ?>”;
}
var pa = document.createElement(‘script’); pa.type = ‘text/javascript’; pa.async = true;
pa.src = (‘https:’ == document.location.protocol ? ‘https:’ : ‘http:’) + “//tag.perfectaudience.com/serve/XXXXXXXXXXXXXXXXX.js“;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(pa, s);
})();
</script>

 

Note – replace the tag with yours.