integrationlatestIntegration / Preset properties
Preset properties
1. Preset properties carried by all events
The following preset properties are carried by all events in the 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 |
| #os_version | OS Version | Text | iOS 11.2.2, Android 8.0.0, etc. |
#manufacturer | Device manufacturer | Text | Manufacturer of the user's device, such as Apple and vivo |
| #os | OS | Text | Such as Android and iOS |
#device_id | Device ID | Text | User's device ID: IDFV or UUID on iOS, androidID on Android |
| #app_version | App version | Text | The version of your app |
| #bundle_id | Unique app identifier | Text | App package name or process name |
#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 |
| #install_time | App install time | Time | Time when the user installed the app; the value comes from the system |
#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. Other preset properties
In addition to the preset properties above, some preset properties are recorded only after you call the corresponding APIs:
| Property name | Display name | Property type | Description |
| #duration | Event duration | Numeric | Requires calling the timing function timeEvent:. Records how long the event lasts, in seconds |
| #background_duration | Background duration | Numeric | Requires calling the timing function timeEvent. Records how long the app stays in the background during the event, in seconds |
3. Get preset properties
You can call the getPresetProperties method to 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.
- Objective-C
- Swift
//Get the property object
TDPresetProperties *presetProperties = [TDAnalytics getPresetProperties];
//Generate event preset properties
NSDictionary *properties = [presetProperties toEventPresetProperties];
/*
{
"#os": "OSX",
"#device_id": "A8B1C00B-A6AC-4856-8538-0FBC642C1BAD",
"#bundle_id": "com.sw.thinkingdatademo",
"#manufacturer": "Apple",
"#system_language": "zh",
"#os_version": "10",
"#zone_offset": 8,
"#app_version":"1.0.0"
}
*/
//Get a specific preset property
NSString *bundle_id = presetProperties.bundle_id;//Package name
NSString *os = presetProperties.os;//OS type, such as OSX
NSString *system_language = presetProperties.system_language;//System language
NSString *os_version = presetProperties.os_version;//OS version
NSNumber *zone_offset = presetProperties.zone_offset;//Time zone offset
let presetProperties = TDAnalytics.getPresetProperties();
//Generate event preset properties
let properties = presetProperties.toEventPresetProperties();
//Get a specific preset property
let bundle_id = presetProperties.bundle_id;//Package name
let os = presetProperties.os;//OS type, such as OSX
let system_language = presetProperties.system_language;//System language
let os_version = presetProperties.os_version;//OS version
let zone_offset = presetProperties.zone_offset;//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?

