At a glance: The CUID enables you to group events of the same user across different devices, applications, media sources, or channels.
What is CUID?
The Customer User ID (CUID) is a unique user identifier that the AppsFlyer SDK can add to install and in-app events. Using the CUID, the events can be cross-referenced with user data extracted from other channels.
Why use CUID?
The CUID enables you to group events of the same user across different devices, applications, media sources, or channels.
Examples
A user with two or more devices has the same CUID. 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 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 platforms.
Setting the CUID
It's recommended to set the CUID before calling the start
method, which sends the install event to AppsFlyer.
Set the CUID in Android
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.
Set the CUID in the global 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.
Set the CUID in an Activity class
When the SDK starts in an Activity
class you don’t have to delay sending the install event. Simply set the CUID before calling start
.
Developer Instructions
Inform the developer of the following:
- Use
waitForCustomerUserId
if the SDK starts in the globalApplication
class - Developer links:
- See Set the CUID in the Application class, If the SDK starts in the
Application
class. - See Set the CUID in an Activity class, If the SDK starts in the
Activity
class.
- See Set the CUID in the Application class, If the SDK starts in the
Set the CUID in iOS
Use the 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.
- If
customerUserId
is called before callingstart
, 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.
Developer Instructions
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 you and your users and doesn't permit the collection or transfer of directly identifiable personal information to the AppsFlyer platform.
To secure the privacy of your users, design the CUID without information directly identifying the user. For example, it should not contain an unencrypted form of the user's email address, name, telephone number, or social security number. Any sensitive information included in the CUID must be encrypted.
- Related reading: Google best practices to avoid sending PII
Further reading
See User journey reports to learn more about the CUID in raw data reports.