Google Ecommerce Tracking
Found multiple posts with no clear answers on this.. Found the code below for adding Google ecommerce tracking in an old post.
Can someone confirm this is correct or guide me to WHERE I might find the right code for Zen Cart to add ecommerce tracking..
Code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxx-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans','<?php echo $zv_orders_id ?>','','<?php echo $zv_order_total_cd ?>','<?php echo $zv_order_tax ?>','<?php echo $order_summary['shipping'] ?>','<?php echo $zv_order_city ?>','<?php echo $zv_order_state ?>','<?php echo $zv_order_country ?>']);
_gaq.push(['_addItem','<?php // Loop through products purchased to track in Google (these come from the "cart_orders_products TABLE)
//sku = "products_model"; productname = "products_name"; category = ""; price = "final_price"; quantity = "products_quantity"
$products_displayed_google = array();
for ($i=0, $n=sizeof($products_array_google); $i<$n; $i++) {
if (!in_array($products_array_google[$i]['id'], $products_displayed_google)) {
echo $zv_orders_id . '\',
\'' . $products_array_google[$i]['model'] . '\',
\'' . $products_array_google[$i]['text'] . '\',
\'\',
\'' . $products_array_google[$i]['price'] . '\',
\'' . $products_array_google[$i]['quantity'] . '\'
' . ((($i+1)<$n) ? ',\'' : '' ) ;
}
}
?>])
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
__utmSetTrans()
</script>
Re: Google Ecommerce Tracking
I think I saw that code in the latest Easy Google Analytics mod
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Design75
I do know it's there, but I ONLY need/want the Google ecommerce tracking (regular Analytics tracking is handled).. Do you know offhand if there is there a way to activate JUST the Google ecommerce tracking using the Easy Google Analytics module?
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
I do know it's there, but I ONLY need/want the
Google ecommerce tracking (regular Analytics tracking is handled).. Do you know offhand if there is there a way to activate JUST the Google ecommerce tracking using the Easy Google Analytics module?
no sorry i do not. I have not had the chance to use it yet.
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
I do know it's there, but I ONLY need/want the
Google ecommerce tracking (regular Analytics tracking is handled).. Do you know offhand if there is there a way to activate JUST the Google ecommerce tracking using the Easy Google Analytics module?
I'm in the final stages of testing some ec analytics code as we speak (actually, I've been testing and tweaking since just before xmas) and am just about at the stage where it would be good to have another set of eyes check it out.
I have to admit, I've never used the Easy Analytics module and I have no idea if using my module in conjunction with this will cause any conflicts anywhere. My code has been created specifically for the EC tracking, but it also tracks some of the other common 'events' (and all pageviews).
My code doesn't require any changes to any of the zencart files. Just 4 new files to upload (with one of those needing to have the UA-xxxxxxx.x number inserted.
Let me know if you are interested in being a guinea pig. Just one thing to keep in mind - There is no way to 'undo' any data submitted to the Google Analytics, so if something goes amiss (such as the same data being logged twice) you'll be stuck with the results/report.
Cheers
RodG
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
RodG
I'm in the final stages of testing some ec analytics code as we speak (actually, I've been testing and tweaking since just before xmas) and am just about at the stage where it would be good to have another set of eyes check it out.
I have to admit, I've never used the Easy Analytics module and I have no idea if using my module in conjunction with this will cause any conflicts anywhere. My code has been created specifically for the EC tracking, but it also tracks some of the other common 'events' (and all pageviews).
My code doesn't require any changes to any of the zencart files. Just 4 new files to upload (with one of those needing to have the UA-xxxxxxx.x number inserted.
Let me know if you are interested in being a guinea pig. Just one thing to keep in mind - There is no way to 'undo' any data submitted to the Google Analytics, so if something goes amiss (such as the same data being logged twice) you'll be stuck with the results/report.
Cheers
RodG
Rod I could kiss you!!! YES I'll guinea pig it, and accept the caveat/risk.. (the risk is minor in the scheme of things) I am NOT using any Google Analytics plugin because this site is one of my WordPress/Zen Cart integration sites, and I am using the WordPress Google Analytics plugin to grab those stats for both WordPress and Zen Cart.. The WordPress plugin obviously doesn't support Google Ecommerce Analytics for Zen Cart (there are plugins for WooCommerce, etc). So I only need the Google Ecommerce Analytics for Zen Cart.
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
YES I'll guinea pig it, and accept the caveat/risk.
<snip>
So I only need the Google Ecommerce Analytics for Zen Cart.
I've just sent you a PM with a link to download.
If anyone else wishes to be a guinea pig please PM me.
Cheers
RodG
ps. This is/will be a free plugin/addon
Re: Google Ecommerce Tracking
Installed like a DREAM.. Works like a charm!!! Rod, it's official.. You are my future ex-husband!!!:laugh: (my silly, late night, sleep deprived way of saying you ROCK and thank you!!!)
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Installed like a DREAM.. Works like a charm!!! Rod, it's official.. You are my future ex-husband!!!:laugh: (my silly, late night, sleep deprived way of saying you ROCK and thank you!!!)
Thanks. I'll give you a few days or so to accumulate more data and identify any problems before I upload it here.
Cheers
RodG
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
RodG
Thanks. I'll give you a few days or so to accumulate more data and identify any problems before I upload it here.
Cheers
RodG
Sure thing.. will let you know.. Got real data since my 2 test sales.. So far still GREAT!!!