Application event logging (offline mode)

Started by
4 comments, last by Sollum 8 years, 3 months ago

Good evening,

When i was making new game, i decided to use Google Analytics to store information about user gameplay sessions. When i was testing my app on phone and tablet, all seemed good. All the events where logged in google analytic.

But then i released my product into public! And crap baskets began to appear...

Events are not appearing in google analytics!

From what i know, if app is offline, events are stored in some sort of memory and then sent to GA, once internet becomes available.

But that data is not appearing.

People try out the game, leave response about somethings, but i simply don't see the data for that in google analytics.

Which means event buffer is flushed from time to time. And if app is offline, data is lost.

Maybe someone had similar issues?

Because the only option i have left is writing my custom background service to send data back to me. Unless of course there's some magical way to increase event buffer size.

Advertisement

Found an interesting and unsettling info:

Data must be dispatched and received by 4 a.m. of the following day, in the local timezone of each profile. Any data received later than that will not appear in reports. For example, if a hit is queued locally at 11:59pm, it must be dispatched within 4 hours, by 3:59am, to appear in reports. On the other hand, a hit queued at 12:00am must be dispatched within 28 hours, i.e. 3:59am of the following day, in order to appear in reports.

So the best solution is pretty much to create IntentService and push events from UI Thread, and dump info into server once WiFi or Mobile Data is enabled. AlarmManager can be used to "awaken" service.

Analytics is (by design) not going to capture 100% of events.

It will capture a large percent, but there are people who are never directly online, people who block and filter traffic, and otherwise those who do not report data back.

Frankly, i fail to see the "design" in current GA for Android.

It does its job well, the only issue is that it doesn't store the data for long period. And we are talking just two or three days here.

Most of data i get is so so, but there is one specific case, where person told me he got a highscore, and i simply didn't get that report. Turns out, he didn't have wifi on for 6 days.

6 days of data is lost.



At this point, I plan to use both GA and custom IntentService to dump the data. Will find out what's better.

High score reporting is a bad match for analytics, as your example poins out.

If you want to track and report things like that, you need to do the work yourself. It is not what analytics was designed for. Analytics is guaranteed to lose values.

Maybe you have encountered any API's or services which cover that?

From the first glance, GA was excellent choice, because its free and API is there.

Now i have to write my own solution plus buy a web hosting, and build a php webie to store info in database.

This topic is closed to new replies.

Advertisement