简体   繁体   中英

How to restart session/handle throttling in Google Analytics Android SDK V2?

I'd like to manually restart some sessions in the Android SDK so I can simulate some data in the Google Analytics framework. According to the sessions documentation and the tracker documenation, it looks like all you have to do is:

for(i=0; i<1000; i++) {
    myTracker.setSession(true);
    myTracker.sendEvent("this", "is a", "test", 1); // this is the first event in the session
}

But when I look at my report, there are ~150 events in the dashboard (that eventually show up after 30 minutes or so). I'm not sure if I'm being throttled or if this method does not completely restart the session. Any ideas on how to best do this without restarting the app 1000 times?

There are two different issues at play : sessions and throttling.

Unfortunately, manually resetting the session (which you are doing here) does not affect throttling. So despite your new sessions, the number of hits to the server is capped at 10 per second per user.

See: Consecutive GA hits being dropped

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM