Forums / General Questions / Google Ecommerce Tracking

Google Ecommerce Tracking

Views: 37,009

Results 21 to 40 of 108
4 Sep 2015, 5:13 PM
#21
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Google Ecommerce Tracking

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.

Jim
Wheaton Website Services

5 Sep 2015, 4:53 AM
#22
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

6 Sep 2015, 4:11 AM
#23
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

6 Sep 2015, 4:55 AM
#24
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

7 Sep 2015, 1:54 AM
#25
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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..

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 "Don’t mix up tracking code snippets from different properties, and don’t 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

 <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:

  ga('send', 'pageview');
</script>

The ec_analytics added code will have ```
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: 
<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 






    

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

7 Sep 2015, 10:25 PM
#26
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

If I discover this is the case, How do I remove the pageview recording from your module??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

7 Sep 2015, 11:24 PM
#27
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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.

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

8 Sep 2015, 2:00 AM
#28
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

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)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

8 Sep 2015, 2:37 AM
#29
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

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.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

8 Sep 2015, 3:14 AM
#30
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

3 Oct 2015, 5:42 PM
#31
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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.

4 Oct 2015, 4:31 AM
#32
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

patternman:

you might want to update your code to adjust to these.

Problem noted. Thanks for that.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

24 Oct 2015, 11:03 PM
#33
michela_marzoli avatar

michela_marzoli

New Zenner

Join Date:
Oct 2015
Location:
Italy
Posts:
1
Plugin Contributions:
0

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

25 Oct 2015, 1:23 AM
#34
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

28 Oct 2015, 8:34 PM
#35
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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..

  1. conversions>> Ecommerce>> Overview: $1,703.83
  2. 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..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

29 Oct 2015, 2:13 AM
#36
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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..

  1. conversions>> Ecommerce>> Overview: $1,703.83
  1. 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.

> 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. :-)

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

31 Dec 2015, 3:37 AM
#37
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Google Ecommerce Tracking

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..

  1. conversions>> Ecommerce>> Overview: $1,703.83
  1. 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..
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
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.

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

31 Dec 2015, 5:03 AM
#38
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

1 Jan 2016, 3:20 AM
#39
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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)

                    $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??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

2 Jan 2016, 9:18 AM
#40
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Google Ecommerce Tracking

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.

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/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.