目录

User ID Calculation Logic

Analytics Kit allows you to identify users in your app by user ID or device. If you want to analyze the data of the same account on different devices and platforms, or analyze the behavior of users who have signed in, you can choose to identify users by user ID.

The anonymous user ID is associated with the user data by Analytics Kit. Only you can use this ID to trace a specific user, while Analytics Kit cannot.

The following example illustrates the user ID calculation logic:

Assume that there are two devices: X and Y. The reported event details are as follows:

Events reported by device X:

  1. User A opened the app on device X and performed a series of operations (No. 1 to 3) without sign-in.
  2. User A used account B to sign in on device X and performed a series of operations (No. 4 to 7).
  3. User A gave device X to another user. This user used account C to sign in on the device and performed a series of operations (No. 8 to 11).
  4. User C signed out and used the device for a period of time (No. 12 and 13) without sign-in.

Events reported by device Y:

  1. User A opened the app on device Y and performed a series of operations (No. 14 to 16) without sign-in.
  2. User A used account B to sign in on device Y and performed a series of operations (No. 17 to 19).

The following table lists the details of events reported by devices X and Y.

No.

Device

Event

Reported Device ID (AAID)

Reported Account ID (User ID)

User Identifier in the System

Sign-In Identifier

1

X

App installation

A

NULL

A

FALSE

2

X

App opening

A

NULL

A

FALSE

3

X

App operation

A

NULL

A

FALSE

4

X

App sign-in

B

B

B

TRUE

5

X

App operation

B

B

B

TRUE

6

X

App operation

B

B

B

TRUE

7

X

App sign-out

B

B

B

TRUE

8

X

App sign-in using another account

C

C

C

TRUE

9

X

App operation

C

C

C

TRUE

10

X

App operation

C

C

C

TRUE

11

X

App sign-out

C

C

C

TRUE

12

X

App operation

A

NULL

A

FALSE

13

X

App operation

A

NULL

A

FALSE

14

Y

App installation

D

NULL

D

FALSE

15

Y

App opening

D

NULL

D

FALSE

16

Y

App operation

D

NULL

D

FALSE

17

Y

App sign-in

B

B

B

TRUE

18

Y

App operation

B

B

B

TRUE

19

Y

App operation

B

B

B

TRUE

The user ID calculation logic is as follows:

The system determines that the operations in the same session are performed by the same user. If operations No. 1 to 7 listed in the preceding table are performed in the same session, the system will automatically supplement the AAID before sign-in with the user ID after sign-in. The supplemented user ID is used as the primary key for subsequent statistics of indicators.

The following table lists the event details after supplementation.

No.

Device

Event

Reported Device ID (AAID)

Reported Account ID (User ID)

User Identifier in the System

Sign-In Identifier

1

X

App installation

A

NULL

A-->B

FALSE

2

X

App opening

A

NULL

A-->B

FALSE

3

X

App operation

A

NULL

A-->B

FALSE

4

X

App sign-in

B

B

B

TRUE

5

X

App operation

B

B

B

TRUE

6

X

App operation

B

B

B

TRUE

7

X

App sign-out

B

B

B

TRUE

8

X

App sign-in using another account

C

C

C

TRUE

9

X

App operation

C

C

C

TRUE

10

X

App operation

C

C

C

TRUE

11

X

App sign-out

C

C

C

TRUE

12

X

App operation

A

NULL

A

FALSE

13

X

App operation

A

NULL

A

FALSE

14

Y

App installation

D

NULL

D-->B

FALSE

15

Y

App opening

D

NULL

D-->B

FALSE

16

Y

App operation

D

NULL

D-->B

FALSE

17

Y

App sign-in

B

B

B

TRUE

18

Y

App operation

B

B

B

TRUE

19

Y

App operation

B

B

B

TRUE

According to the statistics result, there are three users (A, B, and C), among whom two users (B and C) have signed in.