14min

Tracking user data

Unflow allows you to track attributes and behaviours of users within your app so that you can better segment and trigger content

Analytics

We will automatically track a number of analytics events – along with some relevent metadata – as the user interacts with your Unflow content:

Name

Description

screen_viewed

Tracked the first time a screen has been shown to the user.

screen_transitioned

Tracked when a user swipes or taps to progress to the next page, or back to a previous page.

screen_dismissed

Tracked when the user closes the screen.

opener_tapped

Tracked when the user clicks on an opener in a space.

button_tapped

Tracked when a user taps a button.

rating_response

Tracked when a user submits a rating.

You can configure an analytics listener that will receive these UnflowEvents, allowing you to perform your own logic whenever any one of these is sent from the Unflow SDK:

Android
iOS
|

Metadata

The metadata we provide can be used to implement custom logic in your app via the AnalyticsListener detailed above. The metadata is as follows.

Event

Key

iOS Type

Android Type

Notes

screen_viewed

screen_id

Int

Long



screen_transitioned

screen_id

Int

Long





page_id

Int

Long





page_index

Int

Long

Index of the page being transitioned to

screen_dismissed

screen_id

Int

Long



opener_tapped

screen_id

Int

Long



button_tapped

uri

String

String

For a standard Unflow button this will be "unflow://action". For a custom button with a link, the uri will be your custom link.

rating_response

screen_id

Int

Long





rating

Int

Int



These values can be pulled out of the metadata on both platforms. For example, you may wish to know which screen was viewed to send a custom event somewhere else.

iOS
Android
|

Attributes

A custom attribute is a trait or some piece of information about a user – e.g. the day they first signed up to your app. Attributes represent a single value for a user, but this value can change over time.

Attributes can have different data types, depending on the value being tracked. Unflow supports the following attribute types:

  • String
  • Date
  • Number

Once registered you can update any number of attributes at once using a single method call.

Android
iOS
React Native
|

ℹ️ Creating attributes

If an attribute doesn't already exist for the specified key it will be automatically created on the dashboard with the data type set to string

Although it's recommended to set attributes as soon as you know them, they can actually be set at any time and any updated attribute values will be reflected next time Unflow is synced or an event is tracked.

Events

Events are used to track actions taken by users within your app. The same event can be tracked for a single user multiple times, and all occurrences will be recorded so you can see and use information on what your customers do, and how often they do it. For example, you might track an event each time a user completes checkout.

These events that you track can then be viewed in your Unflow dashboard and can be used to segment which users can see your content, as well as when delivery of your content is triggered.

A key needs to be provided for event tracking, with the option of passing additional metadata that can be added to each event for context.

Android
iOS
React Native
|

🧵 When using an iOS SDK version lower than 1.7.1, you must ensure that trackEvent is called on the main thread.

🔁 Tracking an event will also sync your content so there is no need to manually sync immediately after tracking an event. Consider which events you track – you should be tracking events via the Unflow SDK that you require for segmenting and triggering content on the Unflow dashboard.



Sending user data from your backend

We support sending user data over HTTP. See Authentication for information on authenticating requests.

We require the user_id to be set, it should reference a consistent identifier for your user. If the user doesn't exist in our system it will be created.

The attributes key is a key value association, each key corresponds to an attribute in unflow. If an attribute doesn't exist for a provided key we create it for you. Created keys have a default String data type.

You can include an array of events, each event must have an associated key, and uuid. The uuid is required for deduplication, with it you can safely retry or backfill events easily.

We provide information on the attributes that were updated and events that were added.

Once an event is created it cannot be edited, even with subsquent calls with the same key and uuid.

Get a cake by its ID
GET
Code examples
Params
Curl
Node
Python
|
202
400
401
|







Updated 06 May 2022
Did this page help?
Yes
No