Zen Cart

From Growth Agency Wiki
Jump to navigation Jump to search

Google Tag Manager

Install Tag Manager

Main Template file:

includes\templates\<<Theme Folder>>\common\tpl_main_page.php

Could also possibly be template file:

includes\templates\<<Theme Folder>>\checkout_success\tpl_main_page.php

Conversion URLS

Contact Thank-you URL:

index.php?main_page=contact_us&action=success

sale Thank-you URL:

index.php?main_page=checkout_confirmation

Conversion Value

At End of:

includes\templates\<<Theme Folder>>\templates\tpl_checkout_success.php

Place:

<?php

$orders = $db->Execute('SELECT * FROM zen_orders WHERE orders_id = ' . $zv_orders_id . ' LIMIT 1');
$order_total = $orders->fields['order_total'];

?>

<script>dataLayer.push({'order_id' : '<?php echo $zv_orders_id ?>', 'order_value' : '<?php echo $order_total ?>', 'event' : 'order-submitted'});</script>