At a glance: The CUID enables you to group events of the same user across different devices, media sources, or channels.
What is CUID?
The Customer User ID (CUID) is a unique user identifier. It is usually generated and set by the app owner at the time of user registration. The CUID lets app owners follow user journeys across different devices.
A user with two or more devices has the same CUID within an app. Each time the user performs an event on a mobile or desktop device, the event is captured along with the CUID. This enables the advertiser to combine the devices' data into a holistic user view.
A few use cases:
- In-app purchases performed by the same user in the same app but on multiple devices (phone, tablet, TV, desktop) can be combined in a single view.
- User performance in a game installed on multiple platforms (desktop, mobile, TV) can be shared across these platforms to achieve an holistic user experience.
Setting the CUID
Its recommended to set the CUID as early as possible in the SDK initialization flow so that as many events as possible get a CUID association.
Set the CUID in Android
Once the CUID is available, you can set it by calling
setCustomerUserID. The CUID can only be associated with in-app events occurring after it was set. Therefore the install event will not be associated with the CUID when
start is called before
Associate the CUID with the install event
If it’s important for you to associate the install event to the CUID, you should set it before calling
Important: Remember that setting the CUID before
start may block the SDK from sending the install event and thus prevent the attribution from happening. This can occur, for example, when the user launches the application for the first time and then exits before the SDK can set the CUID.
In Android, the
start method and CUID setup can be executed from either the global
Application class or an
Activity class, depending on the app implementation. For more information, refer to Select in what class to start the SDK.
If the SDK starts in the Application class
If you want to associate the CUID with the install event when starting from the global
Application class make sure to delay sending out the install event using the
waitForCustomerUserId method. This method puts the SDK on waiting mode until the CUID is set.
Note: If for some reason setting the CUID fails, the SDK will stay in waiting mode and not send out any events.
If the SDK starts in an Activity class
If you want to associate the CUID with the install event when starting from an
Activity class you don’t have to delay sending the install event. Simply call
setCustomerUserId before calling
Inform the developer of the following:
Set the CUID in iOS
customerUserId method to set the CUID. The location of
customerUserId in relation to the
start method determines what events can be associated with the CUID.
customerUserIdis called before calling
start, the CUID is associated with the install and the following in-app events
- If it is called after
start, the CUID is only associated with events recorded after setting the CUID.
Refer the developer to the following links:
- Setting the Customer User ID in the developer guide.
CUID and privacy
AppsFlyer values and respects the privacy of your users and doesn't permit the collection or transfer of sensitive personal data to the AppsFlyer platform.
To secure the privacy of your users, it is not allowed to design the CUID with information directly identifying the user. This includes social security or national identification numbers.
Furthermore, should the set CUID contain a user's email address or phone number, such information must always be hashed upon sending to AppsFlyer. It is prohibited to send unhashed CUID's containing personal data to AppsFlyer.
- Related reading: Google best practices to avoid sending PII
See User journey reports to learn more about the CUID in raw data reports.