Skip to main content

Event Tracking

You need to track your users' behaviour to understand them. Some behaviour is automatically detected, while other events need to be manually tracked. Many of these methods have analogous events in our website tracker.

Automatically Tracked Events

These events are tracked automatically once the SDK is initialized. Linking and initialising the SDK is enough to take advantage of these; no further integration is required.

EventDescription
Application installedThe app was just installed. Usually can't be sent when the app is actually installed, but instead only sent the first time the app is launched.
Application launchedSomeone has just launched the app.
Application foregroundedThe app was already launched, but it was in the background. It has just been brought to the foreground.
Application backgroundedThe app was in active use and has just been sent to the background.
Push token refreshedThe push token generated by Firebase has been updated.
Notification receivedA push notification was received by the system. On iOS, receiving notifications in quit state requires a Notification Service Extension.
Notification interactedThe user has just clicked on / tapped on / opened a notification.
Error occurredAn error occurred on the client side. We try to detect any problems with actual notification payload on our side, so we don't expect any errors which need to be fed back to end users.

Manually Tracked Events

See the following guides for details on each event type:

Flush tracked events

In order to reduce power and bandwidth consumption, the Ometria library doesn't send the events one by one unless you request it to do so.

Instead, it composes batches of events that are sent to the backend during application runtime when one of the following happens:

  • it has collected 10 events
  • there was a firebase token refresh (pushTokenRefreshed event)
  • a notificationReceived event
  • an appForegrounded event
  • an appBackgrounded event

You can request the library to send all remaining events to the backend whenever you want by calling:

Ometria.flush();

Clear tracked events

You can completely clear all the events that have been tracked and not yet flushed:

Ometria.clear();