My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 448: Enhanced Ecommerce Product Impression On List not firing in Firefox
28 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by [email protected], Jun 24, 2014
---------------------------------------------------------------------------
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

Jul 30, 2014
Project Member #1 [email protected]
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. 
Jul 31, 2014
#2 [email protected]
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.
prodListArrayChrome.PNG
87.6 KB   View   Download
Jul 31, 2014
#3 [email protected]
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.
Jul 31, 2014
#4 [email protected]
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?


Sep 2, 2014
#5 [email protected]
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.
Sep 13, 2014
#6 [email protected]
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.
Sep 19, 2014
#7 [email protected]
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..
Nov 9, 2014
#8 [email protected]
I confirm this issue. Really annoying.
Dec 16, 2014
#9 [email protected]
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;
	}
Jan 21, 2015
#10 [email protected]
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.
Feb 17, 2015
#11 [email protected]
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.
Apr 14, 2015
#12 [email protected]
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...
May 5, 2015
#13 [email protected]
Ran into exactly the same problem and I made a thread about it here:

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

It contains a few screenshots as well. Hope it helps.
Sep 11, 2015
#14 [email protected]
Hi guys, 
this is a serious bug and should be fixed as soon as possible.
I was able to fix it using this workaround: https://code.google.com/p/analytics-issues/issues/detail?id=448#c9 , but it still is a workaround!

It's incredible that this is still in the 'new' status after so long. Please help us.
Oct 22, 2015
#15 [email protected]
The same problem occurs when you use server-side
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters

If a person orders a lot of goods, the data do not reach the GA. Please tell me how to get around this problem
Sign in to add a comment

Powered by Google Project Hosting