Search code examples
androidgoogle-analyticsgoogle-analytics-firebase

In Google Analytics Android app, Is there something called non session events?


Say, there is a background service in app, which fires event on analytics. Now i don't want that event to create a session on Google analytics.

Is there any way?


Solution

  • This can be achieved by using .setNonIntraction(true) in your analytics tracking.

    Tracker t = getGoogleTracker();
    t.send(new HitBuilders.EventBuilder().setCategory(category)
    .setAction(event)
    .setLabel(label).setNonInteraction(true)
    .setValue(l)
    .build());
    

    This works for me like a charm !!!