Limit on Google Analytics asynchronous event push?

2019-02-20 08:04发布

问题:

I have a piece of code that records events in Google Analytics based on an array of data when my application initializes. It goes something like

function recordInitialData(dataArray) {
  for(var i = dataArray.length; i >= 0; i--) {
    _gaq.push(["_trackEvent", category1, action1, label1, dataArray[i].value1],["_trackEvent", category2, action2, label2, dataArray[i].value2]);
  }
}

The problem is, _gaq.push gets called only 10 times (that is to say, there are only 10 1x1 gifs loaded and represent only the first 10 events that were given to _gaq.push), no matter how many calls I actually make (because sometimes dataArray can be quite long). Google Analytics only mentions a limit of 500 event pushes per user session (Analytics Docs). Has this limit of "10 at a time" been documented anywhere?

回答1:

Got an answer from Google directly:

"you can send 10 at once, then they replenish at 1 request per second after that."