-
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!!!
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Sure thing.. will let you know.. Got real data since my 2 test sales.. So far still GREAT!!!
Update: This thing still works FANTASTIC!!! My client's marketing team is quite pleased.. Getting VERIFIABLE results.. In other words, we can reconcile the data in Google Analytics with sales reports from the store.. You module is correctly picking up our sales activity.. Awesome module Rod!!! I think you need to submit this bad boy!!!
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Update: This thing still works FANTASTIC!!! My client's marketing team is quite pleased.. Getting VERIFIABLE results.. In other words, we can reconcile the data in Google Analytics with sales reports from the store.. You module is correctly picking up our sales activity.. Awesome module Rod!!! I think you need to submit this bad boy!!!
Now available for download here:
https://www.zen-cart.com/downloads.php?do=file&id=1997
Cheers
RodG
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
RodG
Totally ROCKIN'!!!!
-
Re: Google Ecommerce Tracking
I would add that this plugin is indeed a plugin and not a core file hack, nor any database edits.
It is for Google Enhanced Ecommerce.
I was last week evaluating Simple Google Analytics and Easy Analytics, both unnecessarily complex.
Thankfully this option came up which is by far the most elegant solution. Easy to install, understand and hence maintain/modify to your needs. Look no further!
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
torvista
I would add that this plugin is indeed a plugin and not a core file hack, nor any database edits.
It is for Google Enhanced Ecommerce.
I was last week evaluating Simple Google Analytics and Easy Analytics, both unnecessarily complex.
Thankfully this option came up which is by far the most elegant solution. Easy to install, understand and hence maintain/modify to your needs. Look no further!
I agree.. Simple Google Analytics and Easy Analytics are IMHO both unnecessarily complex. It is EASY enough to add the standard Google Analytics code snippet to your site.. All I needed after that was the e-commerce tracking (which was the MOST important thing to my client) This module does this QUICKLY and without any fuss..
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
torvista
I was last week evaluating Simple Google Analytics and Easy Analytics, both unnecessarily complex.
In "defence" of these modules, to the best of my knowledge they have both been around for many years and the code has evolved and advanced a lot during this time. They'll (probably) continue to support the older Google API's as well as the newer ones.
They probably support many things the EC Analytics doesn't.
Are they complex? Yes. Are they *unnecessarily* complex? I'm not in a position to judge.
Oh, yeah, they probably also originated before zen-cart added the NOTIFIER system, and *that* is what has kept the EC Analytics method so simple to install and understand. :-)
I really appreciate the positive comments for EC Analytics though.
Cheers
RodG
-
Re: Google Ecommerce Tracking
Hi,
i have this myDEBUG file in log:
PHP Code:
PHP Fatal error: Class 'ec_analytics' not found in /usr/local/psa/home/vhosts/ ... /autoload_func.php on line 79
i use Zen Cart v 1.5.4
Any suggestion ?
Thx
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Nightfly66
Hi,
i have this myDEBUG file in log:
PHP Code:
PHP Fatal error: Class 'ec_analytics' not found in /usr/local/psa/home/vhosts/ ... /autoload_func.php on line 79
i use Zen Cart v 1.5.4
Any suggestion ?
Thx
Double check your installation.. sounds like you missed uploading a file..
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Nightfly66
Hi,
i have this myDEBUG file in log:
PHP Code:
PHP Fatal error: Class 'ec_analytics' not found in /usr/local/psa/home/vhosts/ ... /autoload_func.php on line 79
i use Zen Cart v 1.5.4
Any suggestion ?
Thx
Not really enough information provided, but as DivaVocals stated, "Double check your installation.. sounds like you missed uploading a file" (specifically, the /includes/classes/observers/class.ec_analytics.php file)
Cheers
RodG
-
Re: Google Ecommerce Tracking
I've installed this on a client using Zen Cart 1.5.2. We're using the universal code in the footer and this plugin for ecommerce. Traffic data is working fine, but no ecommerce data.
Enable Ecommerce and Enable Enhanced Ecommerce Reporting are both on.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
jeking
I've installed this on a client using Zen Cart 1.5.2. We're using the universal code in the footer and this plugin for ecommerce. Traffic data is working fine, but no ecommerce data.
Enable Ecommerce and Enable Enhanced Ecommerce Reporting are both on.
Looks like it's a delay in reporting. Data is starting to show up now in GA.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
jeking
I've installed this on a client using Zen Cart 1.5.2. We're using the universal code in the footer and this plugin for ecommerce. Traffic data is working fine, but no ecommerce data.
If you're using both you are probably going to get page traffic double logged.
Cheers
RodG
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
RodG
If that is the case, one of the two modules isn't reporting the pageviews.
Cheers
RodG
Not having ANY issues.. Seriously.. My client's marketing team are the ones who manage the GA stuff. They were the ones who pointed out that the ecommerce tracking was missing which is what led me to your module.. They have indicated to me that since I installed your module that everything is working correctly.. To be clear, I am NOT using any of the other Google Analytics modules for Zen Cart, I dropped the GA code that I got directly from Google Analytics..
-
Re: Google Ecommerce Tracking
Okay for posterity sake.. Here's how I am using this module.. (so anyone following our comedy act here will be clear..:laugh:)
- I have do not have any of the other Zen Cart modules or plugins installed on this site..
- I have installed your Ecommerce tracking module as per the readme..
- I manually add the regular GA code following the instructions from Google: Add the tracking code directly to your site
Everything works perfectly..
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Got it guess we're both confused.. **lol**
Okay for posterity sake.. Here's how I am using this module.. (so anyone following our comedy act here will be clear..:laugh:)
- I have do not have any of the other Zen Cart modules or plugins installed on this site..
- I have installed your Ecommerce tracking module as per the readme..
- I manually add the regular GA code following the instructions from Google: Add the tracking code directly to your site
Everything works perfectly..
Well, it *shouldn't* be 'working perfectly' because with this setup, any page where you've manually added the Google tracking code will (in theory) be recording double page hits. Once from the ec_analytics module and another from your manually added tracking code.
Those instructions from Google can/should be ignored - The code snippet mentioned there is inserted into every page on the site via the ec_analytics javascript.
Yes, I know that the google page (correctly) states "Dont mix up tracking code snippets from different properties, and dont reuse the same tracking code snippet on multiple domains", which I guess could imply that the 'snippet' inserted by ec_analytics isn't going to contain the site specific information, BUT the only different thing from site to site is the GOOGLE_UA number which is the reason why ec_analytics module needs this to be set on a site to site basis.
The rest of the 'snippet' is identical across all sites.
I would suggest that you do a 'view source' on the site where you are using ec_analytics modules and the manually added tracking code, and you'll almost certainly find two instances of
Code:
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-X', 'auto');
There will be additional code after this (up to the closing /script tag) that will vary between the two implementations.
The manually added code will have:
Code:
ga('send', 'pageview');
</script>
The ec_analytics added code will have
Code:
ga('require', 'ec');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
.... and there will be even more additions with the ec_analytics added code on the product info and checkout pages.
It is important that you don't have two instances of this:
Code:
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');
</script>
'cos in theory, Google will be recording a 'pageview' from each instance.
Cheers
RodG
-
Re: Google Ecommerce Tracking
If I discover this is the case, How do I remove the pageview recording from your module??
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
If I discover this is the case, How do I remove the pageview recording from your module??
If that is the case why would you want to remove the pageview from the ec_analytics module rather than the removing the manually added snippets?
Less long term maintenance that way :-)
Apologies for not actually answering your question. I don't have the ec_analytics code readily available to me at the moment.
Cheers
RodG
ps. Could you pm me a link to the site so that I can check if my theory about the possible double logging is true or not. It may turn out to be a non-issue.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
RodG
If that is the case why would you want to remove the pageview from the ec_analytics module rather than the removing the manually added snippets?
Less long term maintenance that way :-)
Apologies for not actually answering your question. I don't have the ec_analytics code readily available to me at the moment.
Cheers
RodG
ps. Could you pm me a link to the site so that I can check if my theory about the possible double logging is true or not. It may turn out to be a non-issue.
Hey Rod..I'll PM the link.. You are probably right about the double logging.. If you are right, I need to have a think on the solution, and this support thread is probably not the right place to have those musings..:smile: (but if I solve the issue I WILL share my solution in case someone has a similar need).. this site is a somewhat unusual case as I have WordPress and Zen Cart integrated, and had installed your module because while I had Google Analytics tracking working fine for both Zen Cart ad WordPress, it was not capturing the ecommerce transactions.. (hence why I wanted your module)
-
Re: Google Ecommerce Tracking
I remember reading in one of the Google sponsored analytics classes (during phase two of the universal analytics roll out) if the same tracker sends a pageview more than once (in a very short time for the exact same tracker properties), the sebsequent calls are ignored. When more than one tracker is created using analytics.js, unless the tracker name is explicitly specified the "default" (usually first) tracker is used to send the calls.
Of course that was along time ago in computer years (and I can no longer find the source material), so the above may not hold true. Best solution (as both of you have mentioned) is only create one tracker and send only one pageview.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
lhungil
I remember reading in one of the Google sponsored analytics classes (during phase two of the universal analytics roll out) if the same tracker sends a pageview more than once (in a very short time for the exact same tracker properties), the sebsequent calls are ignored. When more than one tracker is created using analytics.js, unless the tracker name is explicitly specified the "default" (usually first) tracker is used to send the calls.
Of course that was along time ago in computer years (and I can no longer find the source material), so the above may not hold true. Best solution (as both of you have mentioned) is only create one tracker and send only one pageview.
Thanks for the info.. I need to go back to the marketing team for this client.. I've not been told that there's been an issue, but I want to be VERY sure..
-
Re: Google Ecommerce Tracking
Hi RodG,
Thanks for making this add on. I have it installed and it seems to be working fine.
It was nice and easy.
Except: there seems to be one glitch that I had to overcome.
The mod did not adjust to the use of a single quote (apostrophe) in a category name. When used in a product title, it was just fine and the single quote was properly escaped. But in the category name, it was not escaped and it caused the script to fail. For me, I just changed my titles to use ' instead of the single quote. So now everything's working fine. But you might want to update your code to adjust to these.
Thanks again.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
patternman
you might want to update your code to adjust to these.
Problem noted. Thanks for that.
Cheers
RodG
-
Re: Google Ecommerce Tracking
Hi everybody and thanks Rod for the plugin.
My webmaster installed it (I am on the marketing team) and the transactions are not showing.
Universal Analytics was already installed.
Before he installed the ecommerce tracking as specified from google (not the enhanced). But I needed the enhanced so I suggested him your plugin because he was having troubles installing the google analytics enhanced ecommerce.
He installed the plugin three days ago, everything in analytics seems to be ok but no ecommerce data. (with the google ecommerce tracking data were showing).
I will be very thankful if you could help me,
thanks so much.
Bye from Italy
Michela
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Michela Marzoli
He installed the plugin three days ago, everything in analytics seems to be ok but no ecommerce data. (with the google ecommerce tracking data were showing).
On the google ecommerce settings check that the 'Enable E-Commerce' status is set to 'On'. (No reason to not have the Enhanced reporting enabled either)
Please provide a link to your site so that I/w can confirm that the module itself has been installed and is working correctly (sending valid data to the Google servers)... or not.
Sorry, can't help anything more than that at the moment. Problem could be caused by almost anything. More clues needed please :-)
Cheers
RodG
-
Re: Google Ecommerce Tracking
Okay I'm back.. I fixed the double pageviews issue and we're getting better data coming through, but it still seems that we're getting some inconsistent reporting in Google Analytics. Additionally and seemingly on a random basis some sale transactions aren't captured at all.. I will use one specific days worth of sales to illustrate the issues we are having.
Issue 1:
The product performance view and the ecommerce overview section in Google Analytics are off by a LOT consistently..
- conversions>> Ecommerce>> Overview: $1,703.83
- conversions>> Ecommerce>> Product Performance: $7,703.32
Actual sales activity for this day was $7841.92
Issue 2:
The product performance section of the analytics matches up closest with the website sales, but consistently seems to be missing 1 or 2 transactions. For example:
On this particular day we had sales totaling $7841.92. The analytics shows product performance/sales are $7,703.32. When we map back each transaction in the product performance/sales to the sales reports in the store, one sale of $138.60 is not included in the product performance analytics. This is the exact amount the analytics were off.
Ideal Solution:
If we can get the product performance section of the analytics matching up exactly with the website sales, in my mind it would be fixed, then we can worry about why the overview section of the analytics does not match the product performance section.
Is it possible that certain products/categories are being omitted from the calculation because of syntax issues with the product #'s or descriptions?? Because I'm NOT seeing anything obvious..
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Okay I'm back.. I fixed the double pageviews issue and we're getting better data coming through, but it still seems that we're getting some inconsistent reporting in Google Analytics. Additionally and seemingly on a random basis some sale transactions aren't captured at all.. I will use one specific days worth of sales to illustrate the issues we are having.
Issue 1:
The product performance view and the ecommerce overview section in Google Analytics are off by a LOT consistently..
- conversions>> Ecommerce>> Overview: $1,703.83
- conversions>> Ecommerce>> Product Performance: $7,703.32
Actual sales activity for this day was
$7841.92
You'll need to seek help/advice from someone other than me to explain the discrepancy. Only one set of transaction data is sent to the servers for any given sale, and all 'conversion' figures are derived from this transaction.
I had noticed discrepancies here myself (back when I was closely monitoring the results for this kind of thing) and determined that the Overview included Shipping costs (and possibly taxes) whereas the product performance figures didn't.
I don't think the discrepancies you are seeing can be as easily explained though.
Quote:
Originally Posted by
DivaVocals
Issue 2:
The product performance section of the analytics matches up closest with the website sales, but consistently seems to be missing 1 or 2 transactions. For example:
On this particular day we had sales totaling $7841.92. The analytics shows product performance/sales are $7,703.32. When we map back each transaction in the product performance/sales to the sales reports in the store, one sale of $138.60 is not included in the product performance analytics. This is the exact amount the analytics were off.
Ideal Solution:
If we can get the product performance section of the analytics matching up exactly with the website sales, in my mind it would be fixed, then we can worry about why the overview section of the analytics does not match the product performance section.
Is it possible that certain products/categories are being omitted from the calculation because of syntax issues with the product #'s or descriptions?? Because I'm NOT seeing anything obvious..
YES. Not only is this possible, but also quite likely. See post#37
Cheers
RodG
ps. I'm really bogged down with another project at the moment, so if you do find and fix the place(s) where I've neglected to escape the apostrophes (addslashes) feel free to upload a fixed version. :-)
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Okay I'm back.. I fixed the double pageviews issue and we're getting better data coming through, but it still seems that we're getting some inconsistent reporting in Google Analytics. Additionally and seemingly on a random basis some sale transactions aren't captured at all.. I will use one specific days worth of sales to illustrate the issues we are having.
Issue 1:
The product performance view and the ecommerce overview section in Google Analytics are off by a LOT consistently..
- conversions>> Ecommerce>> Overview: $1,703.83
- conversions>> Ecommerce>> Product Performance: $7,703.32
Actual sales activity for this day was
$7841.92
Issue 2:
T
he product performance section of the analytics matches up closest with the website sales, but consistently seems to be missing 1 or 2 transactions. For example:
On this particular day we had sales totaling
$7841.92. The analytics shows product performance/sales are $7,703.32. When we map back each transaction in the product performance/sales to the sales reports in the store, one sale of $138.60 is not included in the product performance analytics. This is the exact amount the analytics were off.
Ideal Solution:
If we can get the product performance section of the analytics matching up exactly with the website sales, in my mind it would be fixed, then we can worry about why the overview section of the analytics does not match the product performance section.
Is it possible that certain products/categories are being omitted from the calculation because of syntax issues with the product #'s or descriptions?? Because I'm NOT seeing anything obvious..
We finally had to pay a professional who is an expert with Google Analytics, and today he narrowed down the issue which leads to the discrepancies I previously reported.. Here's what he informed me
Quote:
the revenue was being formatted as 1,096, but Google Analytics was not accepting the comma which was creating the issue..
if my client approves I can and will share the fix.. he is reluctant the moment to share because he had to pay this guy in order to get to the bottom of the issue.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
if my client approves I can and will share the fix.. he is reluctant the moment to share because he had to pay this guy in order to get to the bottom of the issue.
Yup, that's one known problem. Easy fix.
3 instances of "number_format()" in the class.ec_analytyics.php file to be updated from:
number_format($value, 2) ;
to
number_format($value, 2, '.','') ;
Another possible/known problem is the lack of escaping single quotes on category/product names.
Feel free to apply and upload these fixes ... I've been way too busy with other projects to worry about it myself. To me, the entire module is/was just a proof of concept rather than a 'polished product'. I won't be offended if you (or someone else) take it over.
Cheers
RodG
-
Re: Google Ecommerce Tracking
My client would like to pass the products_model instead of products_name in this part of the code. (highlighted in red)
Code:
$analytics['addProductItemsStr'] .= "ga('ec:addProduct',"
. " { 'id': '{$items_in_cart->fields['products_id']}',"
. " 'name': '".addslashes($items_in_cart->fields['products_name'])."',"
. " 'brand': '{$brandTxt}',"
. " 'category': '".zen_get_categories_name_from_product($items_in_cart->fields['products_id'])."',"
. " 'variant': '{$varTxt}',"
. " 'price': '".number_format($items_in_cart->fields['final_price'] + ($items_in_cart->fields['final_price'] * $items_in_cart->fields['products_tax'] / 100 ),2)."',"
. " 'quantity': '{$items_in_cart->fields['products_quantity']}',"
. " 'coupon': '{$coupon}',"
. " 'position': '{$i}' } );\n";
Some of his model numbers contain dashes "-", underscores "_", ampersands "&", and/or periods ".". Some of his products also contain one or more of these characters along with single quotes and double quotes, and Google seems to accept these characters just fine. Will replacing products_name with products_model be this simple or is there another way to accomplish this without errors??
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Some of his model numbers contain dashes "-", underscores "_", ampersands "&", and/or periods ".". Some of his products also contain one or more of these characters along with single quotes and double quotes, and Google seems to accept these characters just fine.
As long as they are correctly escaped they should be fine.
The problem with the code I provided is that I didn't add these checks/functions, and I really *should* have done.
Quote:
Originally Posted by
DivaVocals
Will replacing products_name with products_model be this simple or is there another way to accomplish this without errors??
Yup, it will be that simple. Actually, FWIW, as long as the ID is set, this 'name' field is optional. (and vice verci - if the 'name' field is populated, the 'id' field is optional
Ref:
https://developers.google.com/analyt...nced-ecommerce
Cheers
RodG
-
Re: Google Ecommerce Tracking
FYI PHP Fiddle is a very helpful tool for testing changes.. http://phpfiddle.org/
-
Re: Google Ecommerce Tracking
I have setup the checkout labelling funnel steps as follows:
1) Start Login
2) Login Success
3) Checkout Begin (FEC/COWOA)
4) Start Payment
5) Checkout Confirmation
We are using FEC. We are also using the feature of FEC that skips the confirmation page. So the customers enter payment, shipping, etc. in the one page checkout, click Confirm Order, and then are sent to the Checkout Success page. There is no order confirmation page. Do I need to make any adjustments to the steps above?
Thank you!
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Danielle
Do I need to make any adjustments to the steps above?
No. Those steps are just fine. However, I will suggest that you are actually doing this a little backwards.
The reason being is that depending on the store setup (FEC, Standard checkout, PayPal/PayPal Express checkout, etc, etc) the *actual* steps being sent to Google analytics may/will vary from store to store.
So, since the *exact* steps are unknown, the *best* option (at least in my opinion) is to leave the Google settings at their defaults (step 1, step 2, step 3, etc) and let it accumulate the data from whatever is being sent to it from your particular store.
After a period of time (eg: A few hundred sales), the Analytics will show you enough data to clearly identify (for example) Step#1 equated to the 'Start Login' trigger, and that step#2 equates to the login success trigger, and that step#3 hasn't recorded any data (indicating that the confirmation page doesn't exist), and so forth.
Now, having said that, the module 'out of the box' is 'aware' of the different behaviour between a standard zencart checkout and the FEC checkout, so the Google servers will never 'see' the steps that are being skipped.
Anyway, the point I'm trying to make is that the data being sent to the GA servers needs to be determined first, and the 'Labels' that you give these events come afterwards - They are 'cosmetic' only. IOW, in a few months time you may get tired of seeing the the report heading of "Checkout Confirmation", in which case you can just go back to the steps editor and change Step#5 to read 'Order Confirmed'.
The graphed data won't change - Only the text itself.
If you wish to log more (or less) steps this will need some code editing of the module itself - BUT, this is also something that needs to be considered *early* in the game - If you start adding/removing steps after data has been accumulated things can be a real mess, existing data will be mapped to the 'new' step numbers so what was once correctly reported as step1 (login success) could now appear as being 'login start' if 'login start' was a new step#2 entry, making the original step#2 the new step#3 - etc...
There is no way to delete (or resync) existing/old data - other than deleting the account and restarting it afresh.
Cheers
RodG
-
Re: Google Ecommerce Tracking
We are experiencing an issue where two different tax amounts are getting logged. It seems to be adding WA state sales tax of 9.8 % to the “Product Revenue” based on the product price rather than Product Price + Shipping * sales tax….Which is Incorrect for us.
GA Sales Performance transaction report shows:
Revenue: $1,134.51 - Correct
Tax: $ 101.26 - Correct
Shipping: $ 35.26 - Correct
However, when you drilldown to the product it shows:
“Product Revenue: $1,095.80” - WRONG
The ACTUAL product revenue/price is $ 998.00
a) 998*9.8% = 97.804 + 998.00 = $ 1,095.80 – This is product revenue/price * sales tax and added together
b) 998 + 35.26 * 9.8% =101.26 +1033.26 = $ 1,134.51 – This is product revenue/price + shipping * sales tax and then added together
I didn’t see anyone in this thread having this issue, can you point me in the right direction if you are aware of this issue. OR point me to the correct line in class.ec_analytics.php to change how this is calculating tax and adding it to product revenue. Hopefully I explained this well enough.
Thank you in advance
-
Re: Google Ecommerce Tracking
NEVERMIND... I found where the tax was being added to the product price and removed it. Works correctly for us now.
-
Re: Google Ecommerce Tracking
Well, I thought changes we applied fixed the transaction dropping however, it randomly failed to log another transaction after applying the fixes in this thread.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
rockwater
NEVERMIND... I found where the tax was being added to the product price and removed it. Works correctly for us now.
So is this an issue with this module?? If so care to share your solution?
Quote:
Originally Posted by
rockwater
Well, I thought changes we applied fixed the transaction dropping however, it randomly failed to log another transaction after applying the fixes in this thread.
Well you are going to need to provide more detail than this if you are trying to get community support/help. (see the details I provided when I too had an issue with dropped transactions so you can see what kinds of data you should provide)
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
So is this an issue with this module?? If so care to share your solution?
This is what I changed to make the module calc the tax correctly for us. Remember in my previous posting I stated that in WA state tax is charged on shipping. This module was sending tax calculated on the product price and then adding it the product price, AND sending the tax value calculated from the cart which in our case is Product + Shipping X tax. So the solution is to remove the tax calc inside the module.
Line 102: . " 'price': '".number_format((float)($item['price'] + ($item['price'] * $item['tax_class_id'] / 100 )) ,6,'.','')."',"
Change to : . " 'price': '".number_format((float)($item['price']) ,6,'.','')."',"
Line 240: . " 'price': '".number_format($items_in_cart->fields['final_price'] + ($items_in_cart->fields['final_price'] * $items_in_cart->fields['products_tax'] / 100 ),6,'.','')."',"
Change to: . " 'price': '".number_format($items_in_cart->fields['final_price'],6,'.','')."',"
-
Re: Google Ecommerce Tracking
Hi
Just curious, installed this mod yesterday. In the analytics.google.com report under under "All Web site data"/Channels/default channel grouping/Referrals there are a couple of sessions today for paypal.com.
Nobody bought anything via paypal (or failed to purchase) so why/how would paypal be referring potential customers to my site?
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
marton_1
Hi
Just curious, installed this mod yesterday. In the analytics.google.com report under under "All Web site data"/Channels/default channel grouping/Referrals there are a couple of sessions today for paypal.com.
Nobody bought anything via paypal (or failed to purchase) so why/how would paypal be referring potential customers to my site?
Found a fix for this
Code:
Make sure you are using Universal Analytics
Admin -> Property Settings -> Tracking Info -> Referral Exclusion List
Add Referral Exclusion
Insert referral domain - my case was paypal.com
-
Re: Google Ecommerce Tracking
Hi,
First of all, Thanks for this great plugin, I have it installed on our website and it works fine.
Recently we set up an AdWords campagin and we would like to use Adwords conversion tracking.
Can anyone tell how/where to put the Adwords code?
I want to make sure it compatible safe with this plugin.
I read this threat about how to install the code. https://www.zen-cart.com/showthread....rsion-tracking
Is It ok to follow the steps schoolboy suggested in the above threat?
Thank You!
Adrian
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Adrian Ciocīrlan
Recently we set up an AdWords campagin and we would like to use Adwords conversion tracking.
Can anyone tell how/where to put the Adwords code?
I want to make sure it compatible safe with this plugin.
There is no need for adding an additional Adwords conversion script. It would even be contraproductive as the RodG plugin will not work correctly anymore if an additional Adwords conversion tracking is added to the checkout success page.
Just make sure that your Google Analytics account is linked with your Adwords account and you will see everything in Analytics. If the conversion came from an adwords campaign you will see that in Analytics.
I have implemented the findings and fixings from this thread to an updated version of this great plugin and removed some unneccessary code for the specific client it was once written. Will submit it to the download section soon and put it on GitHib as well.
-
1 Attachment(s)
Re: Google Ecommerce Tracking
Hi all, my knowledge isn't very advanced so I wanted to check if I have installed the plugin correctly. It was very simple to install! I had different codes and an old plugin (Easy Google Analytics) installed but have now removed all of the old codes and files. I haven't removed anything from the database or run an uninstall script, should I do this?
My website is - https://www.welsh-lovespoons.co.uk/
The following code now appears on each of our pages. Is this correct? Many thanks.
Attachment 17136
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
bonheddwr
Hi all, my knowledge isn't very advanced so I wanted to check if I have installed the plugin correctly.
A good rule of thumb - if it is working, it is almost certainly installed correctly :)
Quote:
Originally Posted by
bonheddwr
It was very simple to install!
:) :) :)
Quote:
Originally Posted by
bonheddwr
I had different codes and an old plugin (Easy Google Analytics) installed but have now removed all of the old codes and files.
The only code that I know of that would be relevant is the UA-xxxxxxxxx-y (User Account), and this would typically be the same for both the old plugin and this one (assuming the same site is being monitored).
Quote:
Originally Posted by
bonheddwr
I haven't removed anything from the database or run an uninstall script, should I do this?
This question is the main reason for my reply - In an ideal world, and assuming that you *have* removed all the 'old codes and files' ALONG with any other code modifications associated with the old plugin, and also assuming that there is an uninstall script available, then yes, you should do this - BUT, that is a lot of assumptions and we don't live in an ideal world so deleting stuff from a database, either manually or with a script, poses certain risks. It only takes one file to try to reference missing DB data to cause the site to crash.
If you have any doubts whatsoever that you haven't 'undone' all file changes associated with the initial install then leave the database alone.
A database with fields/entries that are no longer needed are completely harmless.
Quote:
Originally Posted by
bonheddwr
The following code now appears on each of our pages. Is this correct?
Yes, that looks correct.
It also shows that when you took this screenshot you was actually logged into the site as a customer :)
Cheers
RodG
-
Re: Google Ecommerce Tracking
Thank you so much for replying above Rod. I've had this installed on the site for around two weeks. I installed this because the Google Analytics code I used previously was only recording a few of the transactions when visiting the google Analytics site (Conversions>Transactions) but the majority were not being recorded. Unfortunately even though page views etc are being recorded correctly it seems the transactions are still not being recorded using this plugin. Has anyone else had the same issue? I spoke to somone from the Google 'Tag implementation team' over a week ago on the phone and after an hour he came up with this code to be inserted at the bottom of tpl_checkout_success_default.php , and when I did a test transaction and paid via my own paypal account the transaction was recorded, but none of the orders since have been recorded! I may be going around things the wrong way, but what I simply want is that all orders are recorded in Analytics, and in Adwords I can compare how much a campaign has cost for a certain period compared to the amount of revenue generated from those Ads during that period.
Would really appreciate any advice!
Code:
<?php
$sql_ordertotal = 'select REPLACE (text,"$","") text from orders_total where orders_id = '.$zv_orders_id.' and class = "ot_total"';
$to_send= $db->Execute($sql_ordertotal);
$order_total = $to_send->fields['text'];
$sql_ordershipping = 'select REPLACE (text,"$","") text from orders_total where orders_id = '.$zv_orders_id.' and class = "ot_shipping"';
$to_send = $db->Execute($sql_ordershipping);
$order_shipping = $to_send->fields['text'];
$sql_tax = 'select order_tax from orders where orders_id = '.$zv_orders_id;
$to_send = $db->Execute($sql_tax);
$order_tax = $to_send->fields['order_tax'];
?>
<script type="text/javascript">
ga('require', 'ecommerce');
var cartTotal = '<?php echo $order_total; ?>';
var CartShipping = '<?php echo $order_shipping; ?>';
var CartTax = '<?php echo $order_tax; ?>';
ga('ecommerce:addTransaction', {
'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required.
'affiliation': 'welsh-lovespoons.co.uk', // Affiliation or store name.
'revenue': parseFloat(cartTotal.replace(/[^0-9.]/g,'')),// Grand Total.
'shipping': parseFloat(CartShipping.replace(/[^0-9.]/g,'')),// Shipping.
'tax':parseFloat(CartTax.replace(/[^0-9.]/g,''))// Tax.
});
<?php
$sql_orderproducts = 'select * from orders_products where orders_id = '.$zv_orders_id;
$row_orderproducts = $db->Execute($sql_orderproducts);
while(!$row_orderproducts->EOF){
$category_id = zen_get_products_category_id($row_orderproducts->fields['products_id']);
$category_name = zen_get_categories_parent_name($category_id);
?>
ga('ecommerce:addItem', {
'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required.
'name': '<?php echo $row_orderproducts->fields['products_name']?>',// Product name. Required.
'sku': 'SKU<?php echo $row_orderproducts->fields['products_model']?>',// SKU/code.
'category': '<?php echo $category_name?>',// Category or variation.
'price': <?php echo number_format($row_orderproducts->fields['products_price'],2)?>,// Unit price.
'quantity': <?php echo $row_orderproducts->fields['products_quantity']?>// Quantity.
});
<?php
$row_orderproducts->MoveNext();
}
?>
ga('ecommerce:send');
</script>
-
Re: Google Ecommerce Tracking
Quote:
ga('ecommerce:addItem', { 'id': <?php echo $zv_orders_id ?>,// Transaction ID. Required. 'name': '<?php echo $row_orderproducts->fields['products_name']?>',// Product name. Required. 'sku':
I am currently knee-deep in nitpicking this plugin to death, to
a) suit my shop and also
b) default shops,
for Google Analytics Enhanced Ecommerce.
I wish to point out that that this bit of code is for Google Analytics Ecommerce Tracking and not for Google Analytics Enhanced Ecommerce. There are differences, minor as they are.
-
1 Attachment(s)
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
bonheddwr
Thank you so much for replying above Rod. I've had this installed on the site for around two weeks. I installed this because the Google Analytics code I used previously was only recording a few of the transactions when visiting the google Analytics site (Conversions>Transactions) but the majority were not being recorded. Unfortunately even though page views etc are being recorded correctly it seems the transactions are still not being recorded using this plugin.
Sorry, but I'm a wee bit confused here.. I'm looking at
https://analytics.google.com/analytics/web/
... but I can't seem to find Conversions>Transactions
I am seeing
Conversions>Goals
Conversions>E-Commerce
Conversions>Multi-channel Funnels
Conversions>Attribution
But no Conversions>Transactions
The sales transactions can be seen at Conversions>E-Commerce>Sales Performance.
Here's a screenshot of what you should be seeing (captured just now, todays last 10 sales)
Attachment 17183
As you can (hopefully) see - all of the TransactionID's are in sequence - no missed sales.
Quote:
Originally Posted by
bonheddwr
Has anyone else had the same issue?
Some folk *have* reported *some* products not being reported/recorded with this module (as I recall, due to apostrophes in the product titles that the module isn't properly escaping, but I don't recall any reports of nothing being recorded at all.
Hmm, did you enable the the Enhanced Ecommerce reporting (on the Analytics website)?
Admin->view->Ecommerce settings
Tick the boxes to 'Enable Ecommerce'
Set the 'Enabled Enhanced Ecommerce Reporting' to 'On'
Quote:
Originally Posted by
bonheddwr
I spoke to somone from the Google 'Tag implementation team'
Perhaps you should be speaking to someone from the Ecommerce Analytics team instead - This has nothing to do with 'Tag implemantion' - That's a whole different kettle of fish.
Quote:
Originally Posted by
bonheddwr
over a week ago on the phone and after an hour he came up with this code to be inserted at the bottom of tpl_checkout_success_default.php ,
He has screwed you over (putting it bluntly) - The entire point of my creating this module is so that you *don't* have to modify any zencart code.
He has also provided you with *old* code - Not the 'Enhanced Ecommerce' code (that the ec module is using).
At the moment (assuming you still have this 'new' code added you are effectively doubling up on the reporting - Google Analytics will either fail to record either, or it will be ignoring one of them. Which one being ignored will possibly be determined by the aforementioned 'Enabled Enhanced Ecommerce Reporting' setting.
Quote:
Originally Posted by
bonheddwr
and when I did a test transaction and paid via my own paypal account the transaction was recorded, but none of the orders since have been recorded! I may be going around things the wrong way, but what I simply want is that all orders are recorded in Analytics, and in Adwords I can compare how much a campaign has cost for a certain period compared to the amount of revenue generated from those Ads during that period.
Adwords is yet another beast entirely.
Quote:
Originally Posted by
bonheddwr
Would really appreciate any advice!
My advice would be to firstly remove any code that you have added to any pages. The ec_analytics module was created specifically to avoid having to do this - and by using this module plus the page additions *will* cause problems.
My next suggestion would be to fire up a Chrome browser, and add the Google Analytics Debugger plugin
https://chrome.google.com/webstore/d...ytics-debugger.
With this installed, and navigating your site (add product, remove product, checkout, etc, etc) you can right click on the page(s) and click the 'inspect' button. This will basically show you exactly what the ec_analytics code is doing on any given page - including the exact data being sent to the Google servers. This will identify any problems or issues.
It's a pretty nifty little add-on - however, it may be a little difficult to understand (depends on skill level).
Cheers
RodG
-
Re: Google Ecommerce Tracking
Thank you very much for your detailed response.
I’m sorry, it should have read Conversions>E-Commerce>Transactions. Mmm, my Google Analytics layout looks slightly different to yours, and all transactions should be listed here not under Sale Performance. As you can see (by the huge gaps between Transaction / order numbers), only a few transactions are being recorded.
'Enabled Enhanced Ecommerce Reporting' was set to ‘Off’, I have now set it to ‘On’. I’ll see if this makes any difference. Thanks for the suggestion.
Thanks for the very detailed comments regarding code I will look into this now! Thanks again, Hedd.
-
Re: Google Ecommerce Tracking
Quote:
My advice would be to firstly remove any code that you have added to any pages. The ec_analytics module was created specifically to avoid having to do this - and by using this module plus the page additions *will* cause problems.
I've removed the extra code suggested by the 'Tag implementation team' now, and after loging in to analytics again, it now looks like yours. The plugin is now the ONLY Analytics code included anywhere on our site (I hope!)
Quote:
Adwords is yet another beast entirely.
Does that mean I need to add a different Adwords code as well? From my understanding from speaking to the Adworeds representative on the phone, he took me through connecting Analytcis and Adwords so the same results should show up in both, I think! It used to be so simple!
Quote:
My next suggestion would be to fire up a Chrome browser, and add the Google Analytics Debugger plugin... It's a pretty nifty little add-on - however, it may be a little difficult to understand (depends on skill level).
And therein lies the problem. I can add plugins, and edit files if I'm told what to do, but that's far as it goes! My understanding when anything goes wrong is next to zero! I wonder if you know of an expert I could pay at an hourly rate, maybe using Google hangouts to see what's happening when I place the order, and why it isn't being recorded in analytics, and help me to correct it? Thanks for all of your support, really appreciate it.
-
1 Attachment(s)
Re: Google Ecommerce Tracking
PS, I don't know if this could be the issue, but we use worldpay and paypal for payments. The URL people arrive at after paying for an order using Worldpay is similar to this. Even though it is our website that appears, the URL is actually secure.worldpay.com . Could this be an issue as to why the orders aren't being recorded?
Attachment 17184
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
bonheddwr
PS, I don't know if this could be the issue, but we use worldpay and paypal for payments.
The URL people arrive at after paying for an order using Worldpay is similar to this. Even though it is our website that appears, the URL is actually secure.worldpay.com . Could this be an issue as to why the orders aren't being recorded?
I'll probably follow this (and your previous post) up with more detail sometime tomorrow (it is after 3am here), but meanwhile I will say that this is a possibility... but only because I know nothing about the worldpay module or how it interacts with the "normal" zencart checkout process.
The ec module & Paypal work fine together, but I'm thinking that if it is only some of the transactions not being recorded could it be that those are the ones being paid for via worldpay?
If that is the case it would imply that the worldpay module is bypassing the code that contains the checkout_success notifier that trigger the ec module to send the data to google... or perhaps it is bypassing a pre checkout notifier that the module uses to obtain the data to be sent.
... or perhaps not.
It would/could be really helpful if you could confirm (or refute) this possibility though... IOW, I'm asking is it the PP transactions being recorded and the worldpay ones not? or is it more random than that?
Cheers
Rod
-
Re: Google Ecommerce Tracking
Note: on success, a payment module should redirect to the checkout_success page. This is true even for hacky integrations like the 3rd-party worldpay contribution.
It's not uncommon for some offsite payment gateways to come back to the store with "their" URL showing in the browser, until the module moves from checkout_process (invisibly) to checkout_success. In other words, it could be the Worldpay module that's not doing all it needs to do in order to be compatible with how other plugins expect things to work post-checkout.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
bonheddwr
my Google Analytics layout looks slightly different to yours,
Does it look more like my screenshot now that you have the "Enabled Enhanced Ecommerce Reporting" set to 'On'?
Anyway, I think we could be on the right track with the assumption that it could be the worldpay module. I've just downloaded this module and after a quick look at the files I noted that it has its own 'checkout_success' php file, but rather than using the default/standard zencart notifier (NOTIFY_HEADER_START_CHECKOUT_SUCCESS) it has its own one defined,
$zco_notifier->notify('NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS');
This means that the ec module is never going to be notified about a successful checkout, therefore, no analytics sales data will be recorded.
Although there are several methods that can be used to rectify the problem I think the 'safest' one one would be to load the file
/includes/classes/observers/class.ec_analytics.php into a text editor.
Find the line that reads
'NOTIFY_HEADER_START_CHECKOUT_SUCCESS',
Then add a line just below it that reads
'NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS',
Then scroll down and find the line that reads
case 'NOTIFY_HEADER_START_CHECKOUT_SUCCESS' ;
Then add another line just below this that reads
case 'NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS' ;
Now, having said that, the *easiest* solution would probably be to
load the file /includes/modules/wp_checkout_success.php into a text editor then *either* change the line that reads
$zco_notifier->notify('NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS');
to
$zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SUCCESS');
OR, simply add this change as a new line/notifier, so the code reads
$zco_notifier->notify('NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS');
$zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SUCCESS');
Either of these options *may* have unexpected side effects though. I've not delved deep enough into the code to may a valid judgement call here.
Cheers
Rod
-
1 Attachment(s)
Re: Google Ecommerce Tracking
Thank you very much for your help. I've tried the option below. I was going to try your 1st option, but I couldn't find the following line in the file
Code:
case 'NOTIFY_HEADER_START_CHECKOUT_SUCCESS' ;
. There was a similar line, but not exactly the same.
Quote:
Originally Posted by
RodG
OR, simply add this change as a new line/notifier, so the code reads
$zco_notifier->notify('NOTIFY_HEADER_START_WP_CHECKOUT_SUCCESS');
$zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SUCCESS');
Unfortunately it doesn't seem that ours is a worldpay only issue. Please see the following image. In the last 6 days only two orders have been recorded in analytics. Both are Paypal ones, but as you will see there are other paypal ones that have not been recorded.
Attachment 17187
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
bonheddwr
Thank you very much for your help. I've tried the option below. I was going to try your 1st option, but I couldn't find the following line in the file
Code:
case 'NOTIFY_HEADER_START_CHECKOUT_SUCCESS' ;
. There was a similar line, but not exactly the same.
There would only be one line of code like this (with a 'case' and a ' NOTIFY_HEADER_START_CHECKOUT_SUCCESS' - so that would've been (is) the right place to add the new line
Quote:
Originally Posted by
bonheddwr
Unfortunately it doesn't seem that ours is a worldpay only issue. Please see the following image. In the last 6 days only two orders have been recorded in analytics. Both are Paypal ones, but as you will see there are other paypal ones that have not been recorded.
You are correct, in that it no longer seems to be a WorldPay only issue - But, thanks to your screenshot, I'm now thinking that you actually have two different issues.
If this were a systemic problem, the fact than 2 of the 6 PayPal transactions were recorded, would suggest that there *should* also have been ~4 of the 12 worldpay transactions recorded - You have *none*. So, I think I/we are still on the right path with these, and you should continue with this approach until you can at least get *some* of the Worldpay ones to show (even if it is just one).
The next step would then be to try to figure out why only *some* transactions are being recorded (regardless of payment method).
The fact that there are more transactions that fail to be recorded than those that succeed could be a clue in itself - Now, I could be *way* off the mark here - but I couldn't help but notice *most* of your product names *appear* to be like
"name dash number"
*Perhaps* the 'dash' is a minus symbol and *something* (the ec module or the Google analytics server) is seeing this as being a mathematical formula rather than as a text string?
Another *perhaps* is that the 'dash' isn't always what it appears - and is possibly some weird UTF8 character that needs to be 'escaped'.
The point/thing here is that if we only look at the PayPal transactions - Two of the six worked - What is it about these two that is *different* from the others - Could it be that these two just happen to be products with the 'dash number' in their names?
Can you see anything else that would differentiate the 2 successful recordings from the 4 failed ones?
Anyway, I still think the 1st step is to get the worldpay transactions to be recorded, because it look like this is how most of your customers are paying, and when this is working we will then have a much bigger data pool in which we can try to find the 'some do, dome don't) differences.
Basically, I feel that you currently have two unrelated problems.
Cheers
Rod
-
Re: Google Ecommerce Tracking
Thanks for all of your help above Rod. You were correct, we had two unrelated issue.
1, For some reason your easy to install plugin didn't work for us. It may be because oure site has been modified quite a bit. Some Paypal transactions were showing in Google Analytics, but not all, and I couldn't fugure out why! I have now installed a different plugin (Easy Google Analytics). It was harder to install than yours, but it seems to be working and recording all paypal transactions.
2, Worldpay!! I've done quite a bit of research, and from what I have found out Worldpay isn't compatible with Google analytics, no matter what plugin is used, or how you install the google analytics code on your site. This makes no sense whatsoever to me, but it seems that currently it's impossible to track trasnactions via Google Analytics if using Worldpay. :/ More info here - https://adigital.agency/blog/google-...ayment-gateway
Thanks again Rod for your help.
-
Re: Google Ecommerce Tracking
1. You claim that the ec_commerce module didn't work, yet you showed screenshots to show that it did, at least some of the time, so that would negate your theory about site modification would be the cause.
2. The blogpost about worldpay is utter BS. Well, it may be true for some systems/modules, but it certainly isn't going to be true for zencart and the ec_commerce module. The ec_commerce module stores the needed data into a session variable before the payment module(s) come into play, and as long as the checkout success notifier is triggered after payment has been made the prestored session data will be sent to google analytics. There is no way that worldpay can prevent this ... you just need to add the $zco notifier into the code that is loaded when worldpay returns back to zencart.
IOW, you do still have two separate problems... one which you have mitigated with a different analytics module (I would have preferred you worked with me on this in order to help others that may have the same issue). The other issue (wordpay) you have chosen to just ignore because some blogpost that has nothing to do with zencart tells you that it doesnt work. I find that a little sad considering that your screenshot shows that most of your sales are paid for with worldpay.
Oh well..
-
Re: Google Ecommerce Tracking
Worldpay ec tracking Can be done... one solution is mentioned here ....https://stackoverflow.com/questions/...-with-worldpay ..... but you dont need the "thank you" page because the zencart notifier (when added/triggered) will call the ec_commerce script to complete the tracking/logging.
-
Re: Google Ecommerce Tracking
ps. I think you must have found the only page/blog on the internet that claims worldpay cant be tracked with google analytics. I easily found that this has been "solved" by numerous ecommerce systems. :)
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
I've been using easy analytics and adwords in zencart 1.5.4. Lots of warnings with this module about running additional analytics code and I understand why about messing up data (been there done that trying to get done with easy analytics - no success).
Looking to use adwords and tag manager and get setup right.
Anyone successfully implemented this? working on this? or should I not attempt this with this module due to its design?
(I am fully aware it will greatly mess up your data if not done correctly)
Thanks for any help in setting this up.
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
Successfully installed module however the Brand: is not passing to the code in the Successful checkout page. I see the brand displayed on all prior pages before checkout is complete. Any ideas as to why this value would not be passed? See below code that was on the checkout page. It appears everything else passes ok. Not sure if this is a bug with the module or not? I tried it loaded in two other theme templates and still occurs.
Code:
ga('require', 'ec');
ga('require', 'displayfeatures');
ga('send', 'event', 'Checkout Success' , 'Order#46926','customerID#17551' );
ga('ec:setAction', 'purchase', { 'id': '46926','affiliation': 'purchaseorder', 'revenue': '67.58', 'tax': '3.58','shipping': '0.00','coupon': 'n/a', 'dimension1': 'customerID#17551' });
ga('ec:addProduct', { 'id': '208', 'name': 'RS232 Cable', 'brand': 'n/a', 'category': 'Cables', 'variant': 'n/a', 'price': '67.58', 'quantity': '1', 'coupon': 'n/a', 'position': '0' } );
ga('send', 'pageview');
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
Just tested with New install of Zen 1.5.4 with sampel products. It does pass the brand on checkout page. HOWEVER.. the brand is not accurate. Here is an example of checked out items. You can see they are mismatched.
Code:
ga('ec:addProduct', { 'id': '8', 'name': 'A Bug\'s Life Linked', 'brand': 'Microsoft', 'category': 'Cartoons', 'variant': 'n/a', 'price': '35.99', 'quantity': '1', 'coupon': 'n/a', 'position': '0' } );
ga('ec:addProduct', { 'id': '105', 'name': 'A Maximum Sample of 1', 'brand': 'Matrox', 'category': 'Big Linked', 'variant': 'n/a', 'price': '50.00', 'quantity': '1', 'coupon': 'n/a', 'position': '1' } );
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
I think I found code bug after trying again for a few hours. This will be my first commit. I submitted problem in Github too as not sure of process. Please double check my work though. Not sure if I should try to submit to zencart. The analytics problem from this is that it causes the brand name only for checked out items to be incorrect. All browsing experience on product pages will record brand properly. In reports though for checked out items in which someone wants to see total sales by brand name it will be incorrect.
Change line 217 of file in includes/classes/observers/class.ec_analytics.php
Change below code from "orders_products_id" to "products_id"
Code:
$brand = zen_get_products_manufacturers_name($items_in_cart->fields['orders_products_id']);
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
Quote:
Originally Posted by
jpietrowiak
I think I found code bug after trying again for a few hours. The analytics problem from this is that it causes the brand name only for checked out items to be incorrect. All browsing experience on product pages will record brand properly. In reports though for checked out items in which someone wants to see total sales by brand name it will be incorrect.
Change line 217 of file in includes/classes/observers/class.ec_analytics.php
Change below code from "orders_products_id" to "products_id"
Code:
$brand = zen_get_products_manufacturers_name($items_in_cart->fields['orders_products_id']);
Thanks for reporting this typo preventing the brand name to be recorded!
Fix confirmed, just submitted an updated 1.2.1 to the download section.
-
Re: Google Ecommerce Tracking with Adwords-Google Tag Manager
hello.
Currently, Google implements gtag for tracking sites, instead of ga.
Can this mod be reweiten using this new library?
Regards
Meksicus
-
Re: Google Ecommerce Tracking
Can anyone tel how to anonymise ip with module, where to put the code so that the visitor's ip is anonymised in Google Analytics?
I read that this code should be inserted in the GA snippet ---- ga('set', 'anonymizeIp', true); --- but not sure where it should go in the EC Analytics Module, and also how to test if it does the job.
Also, is this module sending user ID information to Google Analytics? We don't want this information to be sent by our website to GA.
Need these handeled to make our GA GDPR compilant without the need to gather consent from visitors to run GA.
10x
-
Re: Google Ecommerce Tracking
To use anomyzizeIP with this plugin:
includes/templates/YOURTEMPLATE/jscript/jscript_ec_analytics.php
around line 29
change from
Code:
<?php
//global $analytics, $cID;
$cID = (isset($_SESSION['customer_id'])) ? "customerID#".$_SESSION['customer_id']:"guest";
echo ($cID === "guest") ? "ga('create', '".$trackingID."', 'auto') ;\n":"ga('create', '".$trackingID."', {'userId':'{$cID}'});\n";
echo "ga('require', 'ec');\n";
echo "ga('require', 'displayfeatures');\n";
if (!isset($_SESSION['analytics'])) { echo "ga('send', 'pageview');\n";}
to
Code:
<?php
global $analytics, $cID;
$cID = (isset($_SESSION['customer_id'])) ? "customerID#".$_SESSION['customer_id']:"guest";
echo ($cID === "guest") ? "ga('create', '".$trackingID."', 'auto') ;\n":"ga('create', '".$trackingID."', {'userId':'{$cID}'});\n";
echo "ga('set', 'anonymizeIp', true); \n";
echo "ga('require', 'ec');\n";
echo "ga('require', 'displayfeatures');\n";
if (!isset($_SESSION['analytics'])) { echo "ga('send', 'pageview');\n";}
To be GDPR compliant you should also support the GA Opt-Out Cookie:
Integrate the following link to your privacy policy:
Code:
<a onclick="alert('Google Analytics has been disabled');"href="javascript:gaOptout()">Disable Google Analytics</a>
And integrate the following script somewhere in the head section in includes/templates/YOURTEMPLATE/common/html_header.php
(Change UA-1234567 to your own ID)
Code:
<script type="text/javascript">
var gaProperty = 'UA-1234567';
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) { window[disableStr] = true;
}
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStr] = true; }
</script>
The user ID is sent to Google Analytics but this does not contain any personal data so I' m not sure what should not be GDPR compliant doing so.
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
webchills
To use anomyzizeIP with this plugin:
includes/templates/YOURTEMPLATE/jscript/jscript_ec_analytics.php
around line 29
change from
Code:
<?php
//global $analytics, $cID;
$cID = (isset($_SESSION['customer_id'])) ? "customerID#".$_SESSION['customer_id']:"guest";
echo ($cID === "guest") ? "ga('create', '".$trackingID."', 'auto') ;\n":"ga('create', '".$trackingID."', {'userId':'{$cID}'});\n";
echo "ga('require', 'ec');\n";
echo "ga('require', 'displayfeatures');\n";
if (!isset($_SESSION['analytics'])) { echo "ga('send', 'pageview');\n";}
to
Code:
<?php
global $analytics, $cID;
$cID = (isset($_SESSION['customer_id'])) ? "customerID#".$_SESSION['customer_id']:"guest";
echo ($cID === "guest") ? "ga('create', '".$trackingID."', 'auto') ;\n":"ga('create', '".$trackingID."', {'userId':'{$cID}'});\n";
echo "ga('set', 'anonymizeIp', true); \n";
echo "ga('require', 'ec');\n";
echo "ga('require', 'displayfeatures');\n";
if (!isset($_SESSION['analytics'])) { echo "ga('send', 'pageview');\n";}
To be GDPR compliant you should also support the GA Opt-Out Cookie:
Integrate the following link to your privacy policy:
Code:
<a onclick="alert('Google Analytics has been disabled');"href="javascript:gaOptout()">Disable Google Analytics</a>
And integrate the following script somewhere in the head section in includes/templates/YOURTEMPLATE/common/html_header.php
(Change UA-1234567 to your own ID)
Code:
<script type="text/javascript">
var gaProperty = 'UA-1234567';
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) { window[disableStr] = true;
}
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStr] = true; }
</script>
The user ID is sent to Google Analytics but this does not contain any personal data so I' m not sure what should not be GDPR compliant doing so.
Thanks,
I inserted the code, but how do I test if the ip is indeed anonimysed?
Also, the disable GA script seems to work but what if the user wants to re enable Google Analytics back, how is this done?
-
Re: Google Ecommerce Tracking
Quote:
but how do I test if the ip is indeed anonimysed
Use Chrome
Install the Google Analytics Debugger extension
https://chrome.google.com/webstore/d...hjechhna?hl=en
Go to your website
Check the requests sent to Google Analytics, they should have the &aip parameter set to aip=1
Quote:
but what if the user wants to re enable Google Analytics back
He has to delete the Opt-Out Cookie
Use Firefox Version 60 and above
Go to your website
Click on Site Information > Website Security > more info > show cookies
If the GA Opt-Out Cookie is set you will see:
ga-disable-UA-12345678-9
If you delete this cookie GA is "enabled" again
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
webchills
Use Chrome
Install the Google Analytics Debugger extension
https://chrome.google.com/webstore/d...hjechhna?hl=en
Go to your website
Check the requests sent to Google Analytics, they should have the &aip parameter set to aip=1
He has to delete the Opt-Out Cookie
Use Firefox Version 60 and above
Go to your website
Click on Site Information > Website Security > more info > show cookies
If the GA Opt-Out Cookie is set you will see:
ga-disable-UA-12345678-9
If you delete this cookie GA is "enabled" again
10x so much, appreciate!
-
Re: Google Ecommerce Tracking
Hi,
I'm experiencing 10 to 30 percent of the total number of transactions not appearing in Google Analytics on a daily basis, I'm now using this plugin on a v1.5.1 version, can anyone tell why could this be happening. I canceled all my tag manager tags to test and still some orders not showing up. Could the Google Tag manager code itself be the problem interfering with EC Analytics plug? Has anyone had this problem?
Also, Tag assistant says that GA "Code found outside of <head> tag"
Is yours saying the same thing?
Thanks
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
Adrian Ciocīrlan
I'm now using this plugin on a v1.5.1 version
This plugin is for 1.5.4 and higher. 1.5.1 is completely outdated and should not be live anymore anywhere. You should upgrade to Zen Cart 1.5.5
Quote:
Originally Posted by
Adrian Ciocīrlan
Could the Google Tag manager code itself be the problem interfering with EC Analytics plug?
As stated in the readme there should be NO additional GA code anywhere in your Zen Cart files when using this plugin.
-
Re: Google Ecommerce Tracking
@webchills, i'm getting ready to implement this plugin.... quick question prior to proceeding:
currently, the website makes use the global site tag - google analytics using the gtag.js library; as well as the google tag manager using the gtm.js library.
i'm guessing i need to remove the gtag.js libary; but what about the gtm.js?
thanks in advance!
-
Re: Google Ecommerce Tracking
Code:
function getCatString($id) {
global $db, $cPath ;
$masterCat = zen_get_categories_name_from_product($id) ;
$catTxt = '';
$i = 0 ; $flag = 0 ;
if(isset($cPath)) {
$p = explode('_',$cPath) ;
while ($i < count($p)) {
$the_categories_name= $db->Execute("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $p[$i] . "' and language_id= '" . $_SESSION['languages_id'] . "'");
if ($masterCat == $the_categories_name->fields['categories_name']) {$flag = 1 ;}
$i++ ;
}
$catTxt = substr($catTxt, 1);
}
return ($flag != 1 ) ? $masterCat:$catTxt;
// return $catTxt ;
}
this is in:
NEW FILES/includes/classes/observers/class.ec_analytics.php
$catTxt never gets changed to anything. seems like a bug to me.........
-
Re: Google Ecommerce Tracking
I'm getting some similar data in my analytics account (eg /all-parts/ 1200 view as well as /all-parts 700 views) Notice one has a trailing "/". The one with a trailing "/" also allows for a drilldown in our Google Analytics profile while the other does not allow such.
Upon digging into the problem, I did notice that Easy GA is still loaded in the admin but set as disabled. Is this sufficient, could it be causing part of the aforementioned issue, do I need to delete it altogether?
-
Re: Google Ecommerce Tracking
Update: I've uninstalled the plugin Easy GA.
In google analytics>behavior>site behavior>content drill down....I get multiple line items for the same page. The difference is that one line item has a trailing slash while the other doesn't. In regards to the remaining line items below, they are from tests I performed checking case sensitive variations for that page. All variations were tracked individually in GA. For example:
/Dirt-Bike-Parts 154 page views Content drilldown does not allow for seeing the subfolders
/Dirt-Bike-Parts/ 723 page views The listing with trailing slash allows content drilldown to display subfolders each user visited
/dirt-Bike-parts 1 page views Logged by GA. This was a test I did changing up capitalization
/dirt-Bike-parts/ 1 page views Logged by GA. This was a test I did changing up capitalization and adding the trailing slash.
I would expect all 4 of the above to be captured as a single output in Google Analytics as they are the same page and provide the content drill down. Does anyone have an idea what the cause or solution may be?
-
Re: Google Ecommerce Tracking
Hello,
I've been using this plugin for Google Analytics. I'm tracking visitors but GA is not getting any Ecommerce/sales data. Any ideas?
-
Re: Google Ecommerce Tracking
Hello,
I am looking for a means to quantify "Google pay per click" performance using as they say "Adwords conversion tracking".
Is this Google Ecommerce Tracking module right for this task?
Is it compatible with Zen Cart 1.5.5e?
Thank you for your time in advance.
-
1 Attachment(s)
Re: Google Ecommerce Tracking
Hello again,
I installed this module as Read me text file says.
How to learn that it is working?
I can not see any new Menus in Zen Cart Admin, or there should not be any?
How to verify that installation was correct?
I turned ON E-Commerce setting in GA.
Attachment 18329
Please enlighten newbie. :smile:
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
DivaVocals
Installed like a DREAM.. Works like a charm!!! ... thank you!!!)
Can somebody explain, please, how to check if installation was correct and how this module works.
Should anything be done in Zen Cart Admin (I do not see any new menus)?
I have Google analytics and Adwords campaign, but I am not sure how to test system before I "Enable Ad"?
Should I buy my own product via click on Ad?
Thank you. :smile:
-
Re: Google Ecommerce Tracking
It appears this Thread is outdated.
Nobody responds...
Let's move on. :smile:
-
Re: Google Ecommerce Tracking
This is to help people having trouble with setting up google analytics. Not sure if it will help but it should give you a general idea of how to set it up and what direction to go in
Steps for setting this up Google Ecommerce Tracking
My settings for Easy Google Analytics plugin (configuration/easy google Analytics)
Analytics Enabled: Enabled
Plugin Version 2.4.9
Analytics Account UA-xxxxxxxx-1
Target Address customers
Affiliation
Use SKU code products_id
AdWords Conversion Tracking Active Yes
AdWords Conversion Tracking Number xxxxxx
Google AdWords Language en_US
Analytics Tracking Type universal
Custom Tracking JS Enabled Enable
Google Conversion Label xxxxxx
Custom Tracking JS
Demographics and Interest Reports Enabled
For this module to work correctly you will need to
1. add your Google Analytics account information in the plugin
2. create a conversion tag in AdWords and add it to the plugin.
Example of my conversion tag settings in AdWords
Category: Purchase/Sale
Conversion name: Conversion
Value Use different values. If there's no value, use $0.
Source
Not editable Website
Count One conversion
Conversion window 30 days
View-through window 1 day
Include in "Conversions" Yes
Attribution model Time decay
Once this is complete go to google analytics and see if you are getting traffic. This should tell you if the module is working correctly.
If you want to set up remarketing you will need to add this to your common footer. (you may have to make some minor modifications on the script below to work correctly.) pending on what you consider a conversion. Also there are some modifications you will need to make in adwords in order for the remaketing to work correctly.
Code:
<!-- dynamic remarketing -->
<script>
if(window.location.pathname == "/") {
var google_tag_params = {
ecomm_pagetype: 'home'
};
}else if(jQuery('#indexBody').length>0) {
var google_tag_params = {
ecomm_pagetype: 'category'
};
}else if(jQuery('#productinfoBody').length>0) {
var id = window.location.href.split('products_id=')[1];
var price =parseFloat(jQuery('.productSpecialPrice:first').text().replace(/[^0-9.]/g,''));
var google_tag_params = {
ecomm_prodid: id,
ecomm_pagetype: 'product',
ecomm_totalvalue: price
};
}else if(jQuery('#shoppingcartBody').length > 0) {
var cart_ids = new Array();
jQuery('[name="products_id[]"]').each(function(){
cart_ids.push(jQuery(this).val())
})
var price = parseFloat(jQuery('#cartSubTotal .price').text().replace(/[^0-9.]/g,''));
var google_tag_params = {
ecomm_prodid: cart_ids,
ecomm_pagetype: 'cart',
ecomm_totalvalue: price
};
}else{
var google_tag_params = {
ecomm_pagetype: 'other'
};
}
</script>
<script>
window.addEventListener('load',function(){
try {
ga('set', 'dimension1', window.google_tag_params.ecomm_prodid.toString());
} catch (e) {}
try {
ga('set', 'dimension2', window.google_tag_params.ecomm_pagetype.toString());
} catch (e) {}
try {
ga('set', 'dimension3', window.google_tag_params.ecomm_totalvalue.toString());
} catch (e) {}
ga('send', 'event', 'page', 'visit', window.google_tag_params.ecomm_pagetype.toString(), {
'nonInteraction': 1
});
})
</script>
<!-- eof dynamic remarketing -->
-
Re: Google Ecommerce Tracking
I've found that this mod breaks One-page checkout mod (https://www.zen-cart.com/downloads.php?do=file&id=2095).
When this is installed I only get the default zen cart multiple page checkout process.
I see that you added code specific to FEC/COWOA. Is it possible to update it for lat9's OPC?
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
strelitzia
I've found that this mod breaks One-page checkout mod (
https://www.zen-cart.com/downloads.php?do=file&id=2095).
When this is installed I only get the default zen cart multiple page checkout process.
I see that you added code specific to FEC/COWOA. Is it possible to update it for lat9's OPC?
Did you ever find solution for this?
-
Re: Google Ecommerce Tracking
-
Re: Google Ecommerce Tracking
This thread looks pretty inactive, but I wondered if anyone has used this with Google's GA4.
-
Re: Google Ecommerce Tracking
Hey everyone - This post seems to be pretty dead as it relates to zc 1.5.1 which I'm currently stuck using for the next little while. I've been trying to get EC Analytics (v. 1.2.1) to successfully report sales data to our analytics account and I'm still seeing nothing. I've used Google Tag Assistant to analyze what's being sent to analytics and everything appears to be working as expected up to the point of Checkout Success. Once a user reaches that page, no tags are found, no page views are recorded and no events are fired. The last successful time any of that occurs is at Checkout Confirmation. My question is should the Checkout Success page have any tags or is it correct that it doesn't? I am using EC Analytics as designed and haven't made any modifications. None of my pages have any additional analytics tags anywhere. When looking for transactions inside of my analytics account, all I see is drop offs at the last step and no sessions with transactions. I'm racking my brains here. Any help or advice would be appreciated! Thank you!
-
Re: Google Ecommerce Tracking
Quote:
Originally Posted by
cbooch
as it relates to zc 1.5.1
I cannot comment on the EC part of this BUT if you are still using 1.5.1 you REALLY need to consider upgrading. The security measures added since that release are both significant and numerous. Just my 2 cents....
And yes, this thread seems to be dead. I could use a EC/Google Analytics for Dummies description myself. :)
-
Re: Google Ecommerce Tracking
Hello Team,
Below is most recent instruction (2022) for connecting Google Analytics to the ZenCart.
Can you, please, explain in what file and where in the file on ZenCart is should be inserted.
########################################################
To connect Google Analytics to your website, choose 1 of the following methods that apply:
Option 1: Install a tracking ID through your hosting service or commerce platform
Sign in to your website builder, web hosting service, or commerce platform and paste your tracking ID into the analytics section.
UA-XXXXXX-1
Option 2: Install a tracking tag in your website code
Paste your tracking tag before the closing </head> tag on every page of your website you want to track.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-638871-1">
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXX-1');
</script>
Thank you for your time in advance.
-
Re: Google Ecommerce Tracking
As to Option 2, there is a html_header.php located in includes/templates/YOUR_TEMPLATE/common/
Near the end of that file, you'll see
Code:
</head><?php // NOTE: Blank line following is intended: ?>
Just insert the code above the </head>