Zen Cart: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 42: | Line 42: | ||
<script>dataLayer.push({'order_id' : '<?php echo $zv_orders_id ?>', 'order_value' : '<?php echo $order_total ?>', 'event' : 'order-submitted'});</script> | <script>dataLayer.push({'order_id' : '<?php echo $zv_orders_id ?>', 'order_value' : '<?php echo $order_total ?>', 'event' : 'order-submitted'});</script> | ||
</pre> | </pre> | ||
If a fatal error occurs at same location of script, | |||
check the table name matches to the database as can be changed | |||
Latest revision as of 16:43, 1 December 2020
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>
If a fatal error occurs at same location of script, check the table name matches to the database as can be changed