Collecting data with Trackers and Webhooks

  1. Home
  2. Docs
  3. Collecting data with Trackers and Webhooks
  4. Trackers – collecting data from your own applications
  5. Flutter Tracker
  6. Sessions and data model

Sessions and data model

The Flutter tracker gives you the option to adopt the Snowplow mobile data model across all supported platforms – Android, iOS, and Web. In contrast with the web data model which builds on page view and page ping events, the mobile data model uses screen view events. The mobile data model was chosen in order to make event tracking consistent across all supported Flutter platforms.

In addition to adopting screen view events, the mobile data model defines that sessions are represented using a context entity. Concretely, the client_session context entity is added to all tracked events if session tracking is enabled in the tracker configuration (through the sessionContext property). This entity consists of the following properties:

AttributeDescriptionRequired?
userIdAn identifier for the user of the session.Yes
sessionIdAn identifier (UUID) for the session.Yes
sessionIndexThe index of the current session for this user.Yes
previousSessionIdThe previous session identifier (UUID) for this user.No
storageMechanismThe mechanism that the session information has been stored on the device.Yes
firstEventIdThe optional identifier (UUID) of the first event id for this session.No

Behind the scenes, the Flutter tracker uses the default configuration for session management on the Android, iOS, and Web trackers.

On Android and iOS, session data is maintained for the life of the application being installed on a device. Essentially it will update if it is not accessed within a configurable timeout. There are two inactivity timeouts that result in updates to the sessionId: foreground inactivity, and background inactivity timeout. The default 30 minutes setting is used for both.

On the Web, the tracker uses domain (duid) and session cookies (sid) as implemented by the JavaScript tracker. The session cookie expires after 30 minutes of inactivity. This means that a user leaving the site and returning in under 30 minutes does not change the session. In contrast with the JavaScript tracker, the Flutter tracker also adds the client_session context entity that wraps the domain and session IDs.

If you’d like to learn more about Snowplow BDP you can book a demo with our team, or if you’d prefer, you can try Snowplow technology for yourself quickly and easily.