kalnyc67 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

Enhanced Ecommerce Product Impression On List not firing in Firefox #448

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
---------------------------------------------------------------------------
NOTE: This issue tracking system is for Google Analytics developer products
only.
If you are not a developer/programmer visit:
http://www.google.com/analytics/support.html
---------------------------------------------------------------------------
Name of affected component: Web Tracking (analytics.js)

Enhanced Ecommerce Product List Impression

Issue summary:
Provide a brief summary of the issue you're experiencing.
When viewing a product listing page I have implemented the following script to 
pass back all of the products on a listings page, 

var uv = window.universal_variable;
var i, ii, item_skus = uv.listing.items;
  //purchased products
  if(uv.listing && iscategoryPage ){
  for (i = 0, ii = item_skus.length; i < ii; i += 1) {
        ga('ec:addImpression', {
        'id': item_skus[i].sku_code,
        'name': item_skus[i].name,
        'price': item_skus[i].unit_sale_price,
        'list': location.pathname,
        'position': i+1
      });
      }
  };
ga('send', 'pageview');
(UV is our data layer)

Within Chrome this fires as expected, however in Firefox the script will not 
pass. I can get it to fire only if I comment out name and position as below

var uv = window.universal_variable;
var i, ii, item_skus = uv.listing.items;
  //purchased products
  if(uv.listing && iscategoryPage ){
  for (i = 0, ii = item_skus.length; i < ii; i += 1) {
        ga('ec:addImpression', {
        'id': item_skus[i].sku_code,
//        'name': item_skus[i].name,
        'price': item_skus[i].unit_sale_price,
        'list': location.pathname,
//        'position': i+1
      });
      }
  };
ga('send', 'pageview');

Expected output:
Call to GA made and product listing information passed

Actual results:
No call to GA is made in Firefox

Original issue reported on code.google.com by john.mit...@alexandalexa.com on 24 Jun 2014 at 8:45

GoogleCodeExporter commented 9 years ago
Hi,

I am having a hard time reproducing the issue. I tried this and didn't see any 
issues.

ga('create', ...);
ga('require', 'ec');
ga('ec:addImpression', {
  'id': 'a',
  'name': 'b',
  'price': 'c',
  'list': 'd',
  'position': 'e'
});
ga('send', 'pageview');

Please also describe how it fails.  Does it send the beacon?  Can you show 
analytics_debug.js' output? Also watch out for trailing semicolons and commas. 

Original comment by dspatti...@google.com on 30 Jul 2014 at 5:44

GoogleCodeExporter commented 9 years ago
Hi

Your example also works within Firefox, as it is only passing one item, when 
looping through a page of items i could not get it to pass.

The code above in my original post is what I am using, It fires the code as 
expected in Chrome (I have attached a snip of the debug call in Chrome. Looping 
all the items passed in our data layer (Universal Variable)

However the same page, using the same code in firefox checked using httpFox, 
the header (http://www.google-analytics.com/collect)  is called, but non of the 
parameters are passed. 

More than happy to take this less public if you want to see this on my actual 
website.

Original comment by john.mit...@alexandalexa.com on 31 Jul 2014 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
I found that the pageview was not fired when I was trying to add impressions 
for around 100 products, upon reducing that to 20 products my tracking fired as 
expected. Fortunately I was adding 100 impressions in error so this turned out 
not to be an issue for me.

Original comment by kevin.r...@truedigital.co.uk on 31 Jul 2014 at 4:08

GoogleCodeExporter commented 9 years ago
Ahhhhhh, Thanks Kevin, that got me testing, looks like there is a URL character 
limit being hit within Firefox that I am not getting in Chrome,

By default a product listing page on my site contains 36 items, which in 
firefox is stopping the call from being made.

If I reduce down the number of items (12) I managed to get the beacon to be 
sent to GA.

I cannot reduce the amount of stock on my listing pages, so that isnt an 
option. So what methods could I use to not hit the character limit and still 
make the calls?

Original comment by john.mit...@alexandalexa.com on 31 Jul 2014 at 4:31

GoogleCodeExporter commented 9 years ago
Ive looked into this a bit more,

It appears that when the product list is over a certain size, the ONLY browser 
that completes the call to Google Analytics is Chrome

all other browsers send an empty call to Google, with all the query parameters 
striped off.

There needs to be a better way to implement this.

Original comment by john.mit...@alexandalexa.com on 2 Sep 2014 at 10:51

GoogleCodeExporter commented 9 years ago
I confirm the issue. Lengthy requesit is not sent by the browser. We've 
experienced the same issue with both ec:addImpression and ec:addPromo requests. 
For even lengthier requests even Google Chrome fails to send.

We are waiting for the solution too.

Original comment by IMSadHa...@gmail.com on 13 Sep 2014 at 9:04

GoogleCodeExporter commented 9 years ago
Hi,

We have noticed the same situation while sending product impressions. Since we 
are not using paging and also want to send optional parameters to analyze, we 
need a solution too.

br..

Original comment by aemrearp...@gmail.com on 19 Sep 2014 at 9:04

GoogleCodeExporter commented 9 years ago
I confirm this issue. Really annoying.

Original comment by vincent....@gmail.com on 9 Nov 2014 at 5:53

GoogleCodeExporter commented 9 years ago
I'm having a similar issue, pages with too many products don't commit the 
impression to Analytics. It doesn't seem to work in any browser. I have a page 
with 80 product impressions on it. 

I've also noted in some instances, with Debug mode enabled for Google 
Analytics, that I get the following response:

 Running command: ga("send", "pageview") -> analytics_debug.js:10 Setting throttling cookie: "_gat"

I've not been able to get this response consistently, though I've seen it in 
Chrome, Chrome Canary and Safari at different times. 

I've worked around it with the following (it ain't pretty, but it works):

    // for each set of product impression we  increment a counter
    ga('ec:addImpression', data );
    productCount++;

...

    // we are submitting more than 20 products, flush the data.
    if (productCount > 20)
    {
        ga('send', 'event', { 'eventCategory': 'Analytics Hack', 'eventAction': 'Trigger Beacon', 'eventLabel': 'Nasty Cludge!', 'useBeacon': true});
        productCount = 0;
    }

Original comment by dor...@theusefularts.net on 16 Dec 2014 at 11:09

GoogleCodeExporter commented 9 years ago
This is strange that this issue is still in "New" state.

Even if google cannot manage to deal with payloads > 8192 bytes, they should 
manage it, and drop some product impressions instead of not sending the hit.

Original comment by vincent....@gmail.com on 21 Jan 2015 at 3:44

GoogleCodeExporter commented 9 years ago
Thanks for confirming my suspicions.

I was attempting to send 60 products per page. Rather than limit the number of 
products to 20, I limited the number of characters in the product name to 20 
chars. This appears to be enough to get the pageview to fire.

I'd rather lose the product name entirely and have every product impression 
tracked. Since we also track the product ID, this should not cause any problems 
with future reporting.

Original comment by ashe...@gmail.com on 17 Feb 2015 at 11:23

GoogleCodeExporter commented 9 years ago
Same issue here, sending data for a reasonable amount of products in a listing 
is impossible without workarounds to batch the data into several requests 
(dummy events, etc.). This is highly unconvenient...

Original comment by g...@fenomenibg.com on 14 Apr 2015 at 10:07

GoogleCodeExporter commented 9 years ago
Ran into exactly the same problem and I made a thread about it here:

https://productforums.google.com/forum/#!search/author$3Ame%7Csort:relevance/ana
lytics/FWV_tOx8BXE/3wSHmMjEGbwJ

It contains a few screenshots as well. Hope it helps.

Original comment by george.p...@gmail.com on 5 May 2015 at 9:34