Skip to main content
Version: v3

Data Specification

Device

Device ID

When the SDK is initialized, it generates a unique ID for the terminal, which we call the device ID.

ID Generation Rules

SDKID generation rules
AndroidTry to get the locally saved device ID, Android ID in turn, if neither of them can get the correct result, then randomly generate UUID, the last obtained or generated device ID will be saved in local storage.
iOSTry to get the local keychain saved device ID, if it fails, random UUID will be generated, and the last obtained or generated device ID will be saved in local storage.

Device Property

Device properties are constant values and up-to-date states. The behavior of these users can be analyzed by correlating a characteristic of the device with an event.

FAQ

Will the device ID change?

Android:The device ID is constant when the Android ID can be obtained. (Refer to Google documentation). If the Android ID is not available, the device ID may change as you reinstall the app or reset the Google Ads ID.

iOS:The generated device ID is stored in the device's keychain, which ensures that the device ID is kept stable without resetting the system.

User

User ID

User ID is a registered user ID. When a user registers or logs in, you can set the user's unique ID in your system directly or encrypted into the SDK, and this ID is the user's unique ID across platforms.

User property

User properties is constant values and up-to-date status. propertys or characteristics can be associated with events to analyze the behavior of these users.

Event

What is the event

Preset Events

Event NameEventDescription
device_loginApp LaunchingThis event is reported when the SDK initialization interface is called, and the first time a device ID is reported, a record is generated in the device table.
user_loginLoginThis event is reported when the SDK SetUser interface is called. The first time an account ID is reported, a new record is added to the account table.
play_gameGame timeThe SDK will start with the app entering the foreground as the timing point, and will end when the app enters the background.
chargeUser chargeThis event is reported when the SDK charge interface is called, and it is usually recommended to use the server-side REST API for reporting.

Derivative Events

In addition to reporting preset events, TapDB also records special events, which are called derivative events. Derivative events cannot be reported directly through API, and will only be triggered by preset events.

Event NameEventDescription
dau_deviceApp first launch of the dayThis event is triggered when the App first reports device_login each day and can be used to quickly query the device DAU.
dvau_deviceApp first launch of the day (by version)This event is triggered when the different versions of App first reports device_login each day and can be used to quickly query the device DAU.
wau_deviceApp First launch of the weekApp triggered when device_login is first reported each week, can be used to quickly query device WAU.
mau_deviceApp First launch of the monthApp triggered when device_login is first reported each month, can be used to quickly query device MAU.
dau_userAccount first login of the dayTriggered when the account reports user_login for the first time every day, can be used to quickly check the account DAU.
wau_userAccount first login of the weekTriggered when the account first reports user_login each week, can be used to quickly query the account WAU.
mau_userAccount first login of the monthTriggered when the account reports user_login each month, can be used to quickly query the account MAU.

Custom Events

In addition to preset events and derivative events, more custom events can also be created in the event management.

Data Format

TapDB's REST API supports the JSON object format after URLEncode. If you use SDK to access, the data will also be converted into this format for reporting.

Event Data

Record an event and its propertys:

{
["index" | "client_id"]: ["APPID" | "ClientID"],
"device_id": "DeviceID",
"user_id": "UserID",
"type": "track",
"name": "EventName",
"properties": {
"os": "Android",
"device_id1": "000",
"device_id2": "000",
"device_id3": "000",
"device_id4": "000",
"width": 256,
"height": 768,
"device_model": "pixel",
"os_version": "Android 10.0",
"provider": "O2",
"network": "1",
"channel": "Google Play",
"app_version": "1.0",
"sdk_version": "2.8.0",
"#custem_event_property_name": "CustomEventPropertyValue"
}
}

System Fields

Fields at the same level as properties are system fields.

NameTypeDescription
indexstringThe APPID of the project, you can view the ID in TapDB backend.
client_idstringTapTap Client ID can be viewed in the TapTap Developer Center.
typestringData type, the value of "track" when reporting events.
device_idstringThe device ID at the time of the event.
user_idstringUser ID at the time of the event.
namestringEvent name,can be a preset event or a custom event.

Tips:

  • Preset events device_login,must also have device_id.
  • Preset events user_login, play_game must have device_id and user_id.
  • Preset events charge, must be a valid user_id (user_id was reported as user_login).

Property Fields

The fields inside properties are property fields, which will be the properties of the event, and you can extend them with custom properties.

SDK preset event property:

NameTypeDescription
osstringOperating System(Support Android、iOS、Windows、Mac)
device_id1stringReserved device ID (iOS SDK uses IDFA, Android SDK uses IMEI)
device_id2stringReserved device ID(Android SDK uses Google ads ID)
device_id3stringReserved device ID(Android SDK uses Android ID)
device_id4stringReserved device ID(Android SDK uses OAID)
widthnumberScreen width
heightnumberScreen height
device_modelstringEquipment model (equipment manufacturer + equipment model)
os_versionstringOS Version
networkstringNetwork type (WiFi is 2, unknown is 3, 2G is 4, 3G is 5, 4G is 6)
channelstringAPP Packaging channels
app_versionstringApp version
sdk_versionstringSDK version

Property Action

User property action:

{
["index" | "client_id"]: ["APPID" | "ClientID"],
"user_id": "UserID",
"type": ["initialise" | "update" | "add"],
"properties": {
"level": 15,
"#custom": "custom"
}
}

Device property action:

{
["index" | "client_id"]: ["APPID" | "ClientID"],
"device_id": "DeviceID",
"type": ["initialise" | "update" | "add"],
"properties": {
"level": 15,
"#custom": "custom"
}
}

System Fields

At the same level as properties are the system fields.

NameTypeDescription
client_idstringTapTap Client ID can be viewed in the TapTap Developer Center.
typestringData type, property operations support initialise, update, add.
device_idstringDevice ID of the property operation
user_idstringUser ID of the property operation

Meaning of the type field.

NameDescription
initialiseUse initialise to make only the first value valid. Only if the current value is null, the assignment will take effect, if the current value is not null, the assignment will be ignored.
updateFor regular device properties, you can use update assignment, the new property value will directly overwrite the old property value.
addFor numeric properties, you can use this interface to perform accumulation operation, TapDB will accumulate the original property value and save the result value.

Tips:

  • Only one of device_id and user_id can be selected for property operations. Select device_id for the device ID attribute and user_id for the account ID attribute.

Property Fields

The fields inside 'properties' are property fields. These fields will be treated as fields to be manipulated and treated as' type' values.