integrationlatestIntegration / Preset properties
Preset properties
1. Preset properties
Preset properties collected on different platforms vary to some extent. For details, see the following documents: Android platform, iOS platform
Preset properties on PC platforms:
| 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 |
| #os | OS | Text | For example, macOS, Windows |
| #device_id | Device ID | Text | The user's device ID |
| #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 |
#lib | SDK type | Text | The type of SDK you integrated, such as Android and iOS |
| #lib_version | SDK version | Text | The version of the SDK you integrated |
#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. Get preset properties
When server-side tracking needs some preset properties from the app, you can use this method to get them on the app side and then pass them to the server.
//Get the property object
TDPresetProperties* presetProperties = TDAnalytics::getPresetProperties();
//Generate event preset properties
TDJSONObject* properties = presetProperties->toEventPresetProperties();
/*
{
"#carrier": "中国电信",
"#os": "Android",
"#device_id": "abb8e87bfb5ce66c",
"#screen_height": 2264,
"#bundle_id": "com.sw.thinkingdatademo",
"#manufacturer": "realme",
"#device_model": "RMX1991",
"#screen_width": 1080,
"#system_language": "zh",
"#os_version": "10",
"#network_type": "WIFI",
"#zone_offset": 8,
"#app_version":"1.0"
}
*/
//Get a specific preset property
string bundleId = presetProperties->bundleId;//Package name
string os = presetProperties->os;//OS type, such as Android
string systemLanguage = presetProperties->systemLanguage;//Phone system language
int screenWidth = presetProperties->screenWidth;//Screen width
int screenHeight = presetProperties->screenHeight;//Screen height
string deviceModel = presetProperties->deviceModel;//Device model
string deviceId = presetProperties->deviceId;//Unique device identifier
string carrier = presetProperties->carrier;//Carrier of the phone's SIM card; on dual-SIM phones, the carrier of the primary SIM card is used
string manufacture = presetProperties->manufacturer;//Phone manufacturer, such as HuaWei
string networkType = presetProperties->networkType;//Network type
string osVersion = presetProperties->osVersion;//OS version
string appVersion = presetProperties->appVersion;//App version
double 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?

