Adding tracking code to success page
- 0 Comments
I’m trying to add tracking code to my onepage success page. I’ve created layout and created success.phtml to my custom theme. app/design/frontend/my_theme/Magento_Checkout/layout/checkout_onepage_success.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <script src="module-checkout::templates/success.phtml"/> </head> app/design/frontend/my_theme/Magento_Checkout/templates/success.phtml $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); $totall = $order->getGrandTotal(); ?> <!-- Event snippet for website conversion conversion page --> <script> gtag('event', 'conversion', { 'send_to': 'AW-595825986/_BYQCLj7tr0DEMKqjpwC', 'value': <?php […]
Read More