Preset properties
1. Preset properties carried by all events
The following preset properties are carried by all events in the OpenHarmony SDK, including auto-tracked events
| Property name | Display name | Property type | When collected | Description |
|---|---|---|---|---|
#ip | IP address | Text | Collected on the server | The user's IP address, which AE uses to get the user's geographic location |
| #country | Country | Text | Collected on the server | The user's country, generated from the IP address |
#country_code | Country code | Text | Collected on the server | 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 | Collected on the server | The user's province, generated from the IP address |
| #city | City | Text | Collected on the server | The user's city, generated from the IP address |
| #os_version | OS Version | Text | Collected once at initialization | iOS 11.2.2, Android 8.0.0, etc. |
#manufacturer | Device manufacturer | Text | Collected once at initialization | Manufacturer of the user's device, such as Apple and vivo |
| #os | OS | Text | Collected once at initialization | Such as Android, iOS, and HarmonyOS |
| #device_id | Device ID | Text | Collected once at initialization | User's device ID: IDFV or UUID on iOS, androidID on Android |
| #screen_height | Screen height | Numeric | Collected once at initialization | Screen height of the user's device, such as 1920 |
| #screen_width | Screen width | Numeric | Collected once at initialization | Screen width of the user's device, such as 1080 |
| #device_model | Device model | Text | Collected once at initialization | Model of the user's device, such as iPhone 8 |
| #device_type | Device Type | Text | Collected once at initialization | Device type, such as "Tablet" and "Phone" |
| #app_version | App version | Text | Collected once at initialization | The version of your app |
| #bundle_id | Unique app identifier | Text | Collected once at initialization | App package name or process name |
#lib | SDK type | Text | Collected once at initialization | The type of SDK you integrated, such as Android and iOS |
| #lib_version | SDK version | Text | Collected once at initialization | The version of the SDK you integrated |
| #network_type | Network status | Text | Collected once at initialization and again when the network status changes | Network status when the event is uploaded, such as WIFI, 3G, and 4G |
#carrier | Network carrier | Text | Collected once at initialization | Network carrier of the user's device, such as China Mobile and China Telecom |
#zone_offset | Time Zone Offset | Numeric | Collected when the event occurs | Offset in hours of the data time relative to UTC |
| #install_time | App install time | Time | Collected once at initialization | Time when the user installed the app; the value comes from the system |
#system_language | System language | Text | Collected once at initialization | System language of the user's device (ISO 639-1, that is, two lowercase letters), such as zh and en |
2. Get preset properties
You can call getPresetProperties() 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.
TDAnalytics.getPresetProperties()
/**
{
"#os": "HarmonyOS",
"#os_version": 10,
"#bundle_id": "com.example.tdharmonyosdemo",
"#install_time": "2023-10-19 18:46:00.105",
"#manufacturer": "HUAWEI",
"#device_model": "NOH-AN00",
"#device_type": "phone",
"#screen_width": 1344,
"#screen_height": 2772,
"#system_language": "zh-Hans",
"#carrier": "中国电信",
"#app_version": "1.0.1",
"#device_id": "9811b90b-ee24-45c1-950a-77ee0ffc7a1c",
"#zone_offset": 8
}
*/
3. Disable preset properties
In some scenarios, for compliance or business reasons, you may want to prevent certain preset properties from being collected. When initializing the SDK, configure the disablePresetProperties parameter with an array of the properties to stop collecting. Sample code:
let config = new TDConfig()
config.appId = 'appId'
config.serverUrl = 'url'
config.disablePresetProperties =["#lib", "#lib_version", "#os", "#os_version", "#bundle_id", "#install_time", "#manufacturer", "#device_model",
"#device_type", "#screen_width", "#screen_height","#system_language","#carrier","#app_version","#device_id","#network_type","#ip"]
TDAnalytics.initWithConfig(context, config)

