Thank you so much DrByte! I'll try this out! Now if only they would send some business my way huh? LOL
Thank you so much DrByte! I'll try this out! Now if only they would send some business my way huh? LOL
"yes, just paste that code into a new file, called /includes/modules/pages/checkout_success/jscript_google_purchase.js"
Hello,
I have read other posts that say to call the file like jscript_google.php does it matter, even for older version of zencart?
Thanks
Aloha,
I'm trying to get my conversion tracking to work. I have the code appearing on the page, but want the conversion to include the value of the conversion (ie the total of the order). What is the variable for the total of the order at the checkout_success page?
I've tried <?php echo TEXT_YOUR_TOTAL; ?> but that doesn't work.
Any help is appreciated.
Jivananda and all,
I just finished a chat with Google and to change the value for the order in their code, find the line in the code that reads:
if (Total_Cost) {
var google_conversion_value = 1;
}
and change the value to:
if (Total_Cost) {
var google_conversion_value = Total_Cost;
}
This will then return the total amount of the order placed through your cart. Hope that helps.
I have figured out how to get the total if anyone is interested:
put the following in the jscript_google.php file as mentioned before:
<?php
##Table: zen_orders
##Field: order_total
## is the order id
$orders_query = "SELECT * FROM zen_orders
WHERE orders_id = " . $zv_orders_id ."
LIMIT 1";
$orders = $db->Execute($orders_query);
$order_total = $orders->fields['order_total'];
?>
<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = <your conversion id>;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "6633CC";
if (<?php echo $order_total ?>) {
var google_conversion_value = <?php echo $order_total ?>;
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0 src="https://www.googleadservices.com/pagead/conversion/<your conversion id>/?value=<?php echo $order_total ?>&label=purchase&script=0">
</noscript>
And it works!
Can't you just subscribe to Google Analytics and install the Google Analytics contribution for Zen Cart?
Then you should get full stats and adword tracking! :)
My Contributions: Zen Lightbox | Best Sellers Reloaded