Adding Adwords Conversion code to Opencart Checkout
Google Adwords Conversions can be very useful for tracking what purchases on your site come from paid clicks through a PPC campaign.
Firstly you need to set up the tracking code on your Adwords account:
https://support.google.com/adwords/answer/6095821
To setup the conversion for an Opencart store we are going to track the success page that appears after a successful checkout. This is the page that lives at: catalog/view/theme/your-theme/template/common/success.tpl
However, this page is also used for all other success pages, for example after filling out any form. Therefore we need to check that the use has just completed the checkout page. We do this with a PHP query to check the route of the page we are on.
<?php $url_link_path = $_SERVER['QUERY_STRING'];; if ($url_link_path = “route=checkout/success”) { ?> //Insert Adwords Conversion Code Here <?php } ?>