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:
Events reported by device Y:
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.