I am trying to figure out how to get Google Ad conversion tracking working in Magento 2.3.5 - the Google Ad API setting isn't available under admin area of this version. Universal Tracking Code already installed on every page.
So far I've added the following to the success.phtml file:
<?php
$OrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$Order = Mage::getModel('sales/order')->load($OrderId);
$incrementId = $Order->getIncrementId();
?>
<!-- Event snippet for Purchase conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-XXXXXXXX/XXXXXXXXXXX',
'value': <?php echo number_format($Order->getSubtotal(),2,".",""); ?>,
'currency': 'GBP',
'transaction_id': <?php echo "'".$incrementId."'"; ?>
});
</script>
I think the above code may work for Magento 1. Can anyone suggest an update for Magento 2?
transaction_id
from block class.