After a lot of searching I finally figured out how to add conversion tracking code to my version 1.5 Zen Cart. I have not tested it on other versions. The first thing you need to do is set up conversion tracking in Adwords. Now that you have your code you need to copy and paste it into a text editor.
Now you need to edit your code. Change the value for var google_conversion_value to <?php echo $order_total ?> after the equal sign. Next you need to change the line near the end that starts with “<img height=” Change it to value=<?php echo $order_total ?>&
Make sure the & is still there after the ?>
Now go to your hosting control panel file manager. Get to the directory
public_html/includes/templates//templates. If there is a file named “tpl_checkout_success_default.php” put this code at the very bottom. If there is not a page named tpl_checkout_success_default.php go to the default template normally located in public_html/includes/templates/template_default/templates and copy it over to your template and then paste the code at the bottom of the page.
After you save this file you need to go to “public_html/includes/modules/pages/checkout_success” in your hosts filesystem. Create a file named jscript_google_analytics.php you can call it whatever you want as long as it starts with “jscript_”. Place the code below in this file. The reason I put this code here is because I needed this information in the head because I added eCommerce code in my header.
<?php
##Table: zen_orders
##Field: order_total
## is the order id
$orders_query = “SELECT * FROM orders
WHERE orders_id = ” . $zv_orders_id .”
LIMIT 1″;
$orders = $db->Execute($orders_query);
$order_total = $orders->fields['order_total'];
?>
Save this file and your done.
The best way to test all this is to install the Google Tag assistant in Google Chrome.