1. User Association Introduction

Refer to the User Identification-User Association (Internal Test) section for details.

2. API Introduction

This section only introduces the API functions related to User Global Association. For other tracking interfaces, please refer to the Basic API Functions Introduction.

Minimum Supported Version of ID-Mapping 3.0

Android SDK v6.3.0

2.1. User Login

Call this method when a user logs in. The first parameter is obtained from the detailed list of predefined id keys, and the second parameter is the specific user ID.

After calling the interface, the corresponding key and value will be cached locally, and the collected events will subsequently include the cached ID information.

 SensorsDataAPI.sharedInstance().loginWithKey(String loginIDKey, String loginId);
JAVA

2.2. Multiple User ID Association

Call this method when multiple user IDs need to be associated. The first parameter is obtained from the detailed list of predefined id keys, and the second parameter is the associated user ID.

After calling the interface, the corresponding key and value will be cached locally, and the collected events will subsequently include the cached ID information.

SensorsDataAPI.sharedInstance().bind("$identity_mobile","187****8991")
JAVA

2.3. Multiple User ID Disassociation

Called when multiple user IDs need to be disassociated. The first parameter is the disassociated key, and the second parameter is the corresponding disassociated user ID.

After calling the interface, the relevant unbinding event will be sent, and the corresponding key-value in the local cached ID information will be cleared (if it exists).

SensorsDataAPI.sharedInstance().unbind("$identity_mobile","187****8991")
JAVA

2.4.  Reset Anonymous ID

Used to reset the anonymous ID. If the parameter is empty, a new UUID will be randomly generated as the anonymous ID; otherwise, the specified anonymous ID will be used.

Note: This method can only be used in an anonymous state (i.e. after logout or before login), otherwise the call is invalid.

The difference between this method and identify is that in addition to modifying distinct_id in IDM 2.0, it also modifies the value of $identity_android_id or $identity_android_uuid in IDM 3.0 identities.

SensorsDataAPI.sharedInstance().resetAnonymousIdentity(anonymousId)
JAVA

2.5. Get User ID

Get the ID of the global user.

JSONObject SDKProperties = SensorsDataAPI.sharedInstance().getIdentities(); // 可以获取数据体中的 identities 对象:SDKProperties.identities
JAVA