1

i would like to be able to decide how to pass enhanced ecommerce data to GA: - client side implementation (which is easier) - serverside, using GA uploads (whic is harder)

i would like to say that if some hits length are almost reach 2K length then i simply should do this implementation on server-side.

im also not sure if that's a browser limitation, server side limitation or both. according to ga docs the server-side limit google put is 8K. so i just wonder about the browser side limit: could it be that Safari for example will limit POST requests to 2K? if yes then im trying to understand what is the minimum number i should follow and because of which browser limit.

this question came after as the following came out: google analytics team has launched this cool demo site for enhanced ecommerce: as you can see the first page sends data to GA in POST method. i knew that POST is able to send more data then i decided to investigate a bit: first i got answered on github, been told that this being done automaticaly by analytics.js then i actually test this and saw that GA choses to use POST method when certain amount of data is used.

Community
  • 1
  • 1
  • For max url/GET length there is an answer (that is being kept up-to-date by the author) here http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – Eike Pierstorff Oct 29 '14 at 13:14
  • Hi Eike, the question is regarding POST method, not GET. i know there is a server-side limit by google, im asking if there's any client-side limit (with attention to different browsers). – Yoray Sanela Oct 29 '14 at 13:47
  • Sorry, misread that. In this case the answer is: since there is no info available anywhere we cannot say, but can conclude that for practical purposes there is no limit set by the browser (we can say for sure there is no limit set by the http spec). – Eike Pierstorff Oct 29 '14 at 13:55

1 Answers1

3

The limits are the same.

Analytics.js will use GET to send hits if under 2k and if over that it will use POST via XMLHttpRequest and XDomainRequest (IE8-9). Hits over 8K are thrown out.

You can test this using the following commands

ga('send', 'pageview'); // Sends GET
ga('send', 'pageview', new Array(4000).join('A')); // Sends POST
ga('send', 'pageview', new Array(9000).join('A')); // Hit dropped
David Pattison
  • 269
  • 1
  • 3
  • thanks David, so your saying that browsers not suppose to limit POST requests - its 8K analytics.js or GA server-side limit for all browsers (at least the major browsers) – Yoray Sanela Oct 30 '14 at 00:48
  • The 8K limit is a policy that GA has. It has nothing to do with any browser or client limits. – David Pattison Nov 05 '14 at 22:56