This document outlines the data flow model used by Mobile Engage.
Device and user registration
When customers install your mobile app they have the opportunity to register with you. When they do, the data is sent to your backend. Here, an internal contact identifier is created and this is sent back to the app, where it is stored locally.
Apart from this, the customer’s data should be created (or updated) in the Emarsys API database.
Obtaining and storing the push token
When your app is registered with Google and/or Apple, a push token is created for you. As soon as your clients opt in to receiving push notifications, this push token becomes available from our SDK incorporated in your app.
The push token is now sent to the Mobile Engage API where it is stored in its database. At the same time, Mobile Engage sets the
push_accepted field to
1 in the Emarsys contact database and the device is listed in the Mobile Engage device registry.
Handling user data
After the mobile app is installed, it can immediately start to process events. These events are sent to the Mobile Engage SDK and their data is stored locally in the SDK.
If there is a logout or login event happening in the app and the active contact in the app has changed, the app has to decide whether it should update the contact data or not.
From this point the loop repeats itself.
Working with contacts
- Without contact identifier data
- With contact identifier data
Contact identifier data means data that can be used to determine exactly who the contact using the app is.
1. Calling without contact identifier data
appLogin function (iOS, Android) is called without contact identifier data, it has to determined whether a Mobile Engage Created (MEC) contact exists for this device or not. If not, the MEC contact is created. If there is a contact for the device, the
contact_id is associated with the device. The email address of the contact is not known.
2. Calling with contact identifier data
appLogin function (iOS, Android) is called with the contact identifier data, the active
contact_id is associated with the device, together with the other known data of the user, e.g. email address. If there is also a push token associated to the user, personalized push notifications can be sent out.
If the logout function is called, since the contact has logged out, the MEC contact is re-associated with the device and from this point the MEC contact is using the app again.
Handling opened messages
When a push message is sent from Emarsys, we forward the message to Google or Apple. From these messaging platforms the message is sent to your mobile app.
When the user opens the push notification, the
trackMessageOpen function must be called in the SDK. On Android, this happens automatically, but on iOS it should be done manually. Then the SDK sends the
sid parameter contained in the message to the API.
The Mobile Engage backend is linked to the Mobile Engage reporting service, where this information is processed.