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.
| Event | Description |
|---|---|
| Application installed | The 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 launched | Someone has just launched the app. |
| Application foregrounded | The app was already launched, but it was in the background. It has just been brought to the foreground. |
| Application backgrounded | The app was in active use and has just been sent to the background. |
| Push token refreshed | The push token generated by Firebase has been updated. |
| Notification received | A push notification was received by the system. On iOS, receiving notifications in quit state requires a Notification Service Extension. |
| Notification interacted | The user has just clicked on / tapped on / opened a notification. |
| Error occurred | An 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:
- Profile Events - User identification and logout
- Product Events - Product views and listings
- Basket Events - Shopping cart interactions
- Order Events - Checkout and purchases
- Screen Events - Home and custom screen views
- Custom Events - App-specific events
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 (
pushTokenRefreshedevent) - a
notificationReceivedevent - an
appForegroundedevent - an
appBackgroundedevent
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();