As a web developer and digital marketian, I have worked on too many website, which was/is developed on different -different type of CMS, custom platform and frameworks.
As a digital marketian, when I was trying to implement google or any other ads agency code, I faced some challenges and also too many other guys asked too many questions, like:
How to add conversion tracking code on Magento?
Where do we have to add conversion tracking on Magento?
How to fetch conversion value/total value in magento?
Here I have mentioned Simple solution of all 3 questions. But to implement conversion code(Google Adwords) you must have access of Admin panel or FTP access of the site.
If you have only admin access or light knowledge of web development, you can use Magento Adword Conversion extension(paid/free) from Magento Commerce.
But if you are a developer and you have FTP access you can follow below steps to add conversion code with value in Magento:
- Login to FTP.
- Open success.phtml (file path: app->design->frontend-> yourPackage->yourTheme->template->checkout->success.phtml).
- Add the below code in bottom of success.phtml.
<?php $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId()); $subtotal = $order->getSubtotal(); $gtotal = $order->getGrandTotal(); ?> // add Conversion code here and replace conversion value with <?php echo $gtotal;?><br>
Just after above code add your conversion code and replace conversion value with in both script tag as well as noscript tag.
If any issue kindly leave comment or contact me.
Note: Above mention code will work on Magento v1.x(Like 1.9, 1.8, ..)