Google Analytics - track multiple events in single HTTP request

有些话、适合烂在心里 提交于 2019-12-03 07:48:00
jk.

It was possible with the previous version of GA (ga.js): Can I track multiple Google Analytics events at once?

And, it's possible with the universal version: Setting Parameters Across Multiple Send Commands

In some cases you might want to set a parameter and have the value persist across multiple send commands. For example, if you have a webpage in which you want to track one pageview and two events.

In the above example, Google is illustrating setting a specific page parameter but it also shows sending multiple events.

It is not possible to track multiple GA events with single HTTP request.

Finally, I implement server side event registration via Measurement Protocol. There is still 1 HTTP request to GA servers per event, but it does not affect end users.

I've been trying to do the exact same thing and I see only 2 solutions:

  1. Reverse engineer the Android SDK's Dispatch API
  2. Write an intermediate log proxy that accepts batch requests and then forward the individual requests directly to GA's Measurement Protocol
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!