integrationlatestIntegration / Preset properties
Preset properties
1. Preset properties for all events
The following preset properties are carried by all events (including auto-tracked events) in the Mini Program/Mini Game SDK
| Property name | Display name | Property type | Description |
|---|---|---|---|
#ip | IP address | Text | The user's IP address, which AE uses to get the user's geographic location |
| #country | Country | Text | The user's country, generated from the IP address |
| #country_code | Country code | Text | The country code of the user's country (ISO 3166-1 alpha-2, that is, two uppercase letters), generated from the IP address |
| #province | Province | Text | The user's province, generated from the IP address |
| #city | City | Text | The user's city, generated from the IP address |
| #device_model | Device model | Text | Model of the user's device, such as iPhone 8 |
| #device_id | Device ID | Text | The user's device ID, which is the UUID generated during initialization |
| #screen_height | Screen height | Numeric | Screen height of the user's device, such as 1920 |
| #screen_width | Screen width | Numeric | Screen height of the user's device, such as 1080 |
| #manufacturer | Device manufacturer | Text | Manufacturer of the user's device, such as Apple and vivo |
| #os_version | OS Version | Text | iOS 11.2.2, Android 8.0.0, etc. |
| #os | OS | Text | Such as Android and iOS |
| #network_type | Network status | Text | Network status when the event is uploaded, such as WIFI, 3G, and 4G |
| #lib | SDK type | Text | The type of SDK you integrated, such as MP (mini program) and MG (mini game) |
| #lib_version | SDK version | Text | The version of the SDK you integrated |
| #scene | Scene value | Numeric | The scene value passed in when the mini program or mini game launches |
| #mp_platform | Mini program platform | Text | Identifies the platform where the app runs |
| #zone_offset | Time Zone Offset | Numeric | Offset in hours of the data time relative to UTC |
| #system_language | System language | Text | System language of the user's device (ISO 639-1, that is, two lowercase letters), such as zh and en |
2. Preset properties of auto-tracked events
The following preset properties are specific to each auto-tracked event
- Preset properties of mini program launch (ta_mp_show)
| Property name | Display name | Property type | Description |
|---|---|---|---|
| #url_path | Page path | Text | Path of the page displayed when the mini program launches |
#start_reason | Launch reason | Text | A JSON string; the parameter obtained from the getLaunchOptionsSync API |
- Preset properties of mini program hide (ta_mp_hide)
| Property name | Display name | Property type | Description |
|---|---|---|---|
| #duration | Event duration | Numeric | The duration from this launch ta_mp_show to the hide ta_mp_hide, in seconds |
- Preset properties of mini program page view (ta_mp_view)
| Property name | Display name | Property type | Description |
|---|---|---|---|
| #url_path | Page path | Text | Page path, that is, the path of the displayed page |
| #referrer | Referrer path | Text | Path of the page before the displayed page, that is, the path before the jump. If the page is the home page displayed when the mini program launches, the value is "直接打开" |
- Preset properties of mini program page sharing (ta_mp_share)
| Property name | Display name | Property type | Description |
|---|---|---|---|
| #url_path | Page path | Text | Path of the page where the mini program is shared |
3. Get preset properties
When server-side tracking needs some preset properties from the app, you can use this method to get the preset properties on the client side and then pass them to the server.
//Get the property object
var presetProperties = TDAnalytics.getPresetProperties();
//Generate event preset properties
var properties = presetProperties.toEventPresetProperties();
/*
{
"#device_model":"iPhone 5",
"#device_id":"3204487163-1624513721217",
"#screen_width":320,
"#screen_height":568,
"#os":"iOS",
"#os_version":"10.0.1",
"#network_type":"wifi",
"#zone_offset":8,
"#manufacturer":"Apple"
}
*/
//Get a specific preset property
var os=presetProperties.os;//OS type, such as Android
var osVersion=presetProperties.osVersion;//OS version
var networkType=presetProperties.networkType;//Network type
var manufacture=presetProperties.manufacturer;//Device manufacturer
var deviceModel=presetProperties.deviceModel;//Device model
var screenWidth=presetProperties.screenWidth;//Screen width
var screenHeight=presetProperties.screenHeight;//Screen height
var deviceId=presetProperties.deviceId;//Device ID
var zoneOffset=presetProperties.zoneOffset;//Time zone offset
IP address, country, and city information is parsed and generated on the server side. The client doesn't provide APIs to get these properties
Was this page helpful?

