Structuring the App: Handle same User login on different devices

Introduction

In this article we are going to explain what happens when the same User logs into separate devices.

Scenario

Device A: User starts the app, logs in (which means their UserID is being passed to Leanplum) and starts logging data. This user is also placed into an A/B test experiment, let's say in the Control bucket.

Device B: The same person opens up the app on a different device for the first time. A new User Profile is being created, using as default the DeviceID as UserID. The user is still not logged in, therefore is, of course, a separate User Profile than the one being used for Device A. This device starts logging data and is placed into the same A/B test experiment as Device A but this time is placed (for example) in the Variant group.

On Device B the user then logs in, using the same UserID being used when logged in on Device A. What happens?

Result

Users and attributes

The two User profiles now merge under the same UserID.

The User will now have both the DeviceIDs in the User Profile, the data collected (events and session information) will be merged under the same Milestones list.

User Attributes will merge. In case of same User Attributes, the values being set on Device B will win and be displayed in this case as they were the last set values.

A/B test experiment variants will merge too, in this case all devices will be placed in the first variant the user was placed in. So for our example, the Control one being set for Device A.

Push Notifications

For Push Notifications, every device in the User Profile with a valid token would get a Push Notification if the User is being targeted by the Push Notification message.

This applies to all the different scenarios in which the UserID would be included as a target for Push Notifications.

In the case of tracking an event triggering a Push Notification campaign, it doesn't matter which is the specific device tracking the event - if the User is included in the Push Notification targets, then all the devices with a Push token in the User Profile will receive the push.