Skip to main content

Preset properties

Last updated 10/03/2026

1. Preset properties carried by all events​

The following preset properties are carried by all events in the Android SDK, including auto-tracked events

Property nameDisplay nameProperty typeWhen collectedDescription

#ip

IP address

Text

Collected on the server

The user's IP address, which AE uses to get the user's geographic location
#countryCountryTextCollected on the serverThe user's country, generated from the IP address

#country_code

Country codeText

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
#provinceProvinceTextCollected on the serverThe user's province, generated from the IP address
#cityCityTextCollected on the serverThe user's city, generated from the IP address
#os_versionOS VersionTextCollected once at initializationiOS 11.2.2, Android 8.0.0, etc.

#manufacturer

Device manufacturerTextCollected once at initializationManufacturer of the user's device, such as Apple and vivo
#osOSTextCollected once at initializationSuch as Android and iOS
#device_idDevice IDTextCollected once at initializationUser's device ID: IDFV or UUID on iOS, androidID on Android
#screen_heightScreen heightNumericCollected once at initializationScreen height of the user's device, such as 1920
#screen_widthScreen widthNumericCollected once at initializationScreen width of the user's device, such as 1080
#device_modelDevice modelTextCollected once at initializationModel of the user's device, such as iPhone 8
#device_typeDevice TypeTextCollected once at initializationDevice type, such as "Tablet" and "Phone"
#app_versionApp versionTextCollected once at initializationThe version of your app
#bundle_idUnique app identifierTextCollected once at initializationApp package name or process name

#lib

SDK typeText

Collected once at initialization

The type of SDK you integrated, such as Android and iOS
#lib_versionSDK versionTextCollected once at initializationThe version of the SDK you integrated
#network_typeNetwork statusTextCollected once at initialization and again when the network status changesNetwork status when the event is uploaded, such as WIFI, 3G, and 4G

#carrier

Network carrierText

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_timeApp install timeTimeCollected once at initializationTime when the user installed the app; the value comes from the system
#simulatorWhether it is a simulatorBooleanCollected once at initializationWhether the device is a simulator: true/false

#ram

Device memory status

Text

Collected when the event occurs

Current available memory and total memory of the user's device in GB, such as 1.4/2.4 (not collected by default in v3.2.0 and later)

#disk

Device storage statusTextCollected when the event occurs

Current available storage and total storage of the user's device,

in GB, such as 30/200 (not collected by default in v3.2.0 and later)

#fps

Device frame rate

Numeric

Collected when the event occurs

Current frame rate (frames per second) of the user's device, such as 60 (not collected by default in v3.2.0 and later)

#system_language

System languageTextCollected once at initializationSystem 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 the APP start event (ta_app_start)
Property nameDisplay nameProperty typeDescription

#resume_from_background

Resumed from background

BooleanIndicates whether the APP was opened or woken from the background. true means it was woken from the background, and false means it was opened directly
#start_reason

Launch reason

TextThe content is a JSON string. When the APP is opened through a URL or an intent, the URL content and the data in the intent are recorded automatically. Example: {url:"thinkingdata://","data":{}}

#background_duration

Background duration

Number

The time the app spent in the background between two start events,

in seconds

  • Preset properties of the APP end event (ta_app_end)
Property nameDisplay nameProperty typeDescription
#durationEvent duration

Number

The duration of this APP visit (from start to end), in seconds
  • Preset properties of the APP view page event (ta_app_view)
Property nameDisplay nameProperty typeDescription
#titlePage TitleTextTitle of the Activity that the view belongs to, taken from the title attribute
#screen_namePage nameTextPackage name.class name of the Activity that the view belongs to
#urlPage URLTextURL of the current page. Call getScreenUrl to set the URL
#referrerReferrer URLTextURL of the page before the jump. The previous page must call getScreenUrl to set the URL
  • Preset properties of the APP control click event (ta_app_click)
Property nameDisplay nameProperty typeDescription
#titlePage TitleTextTitle of the Activity that the view belongs to, taken from the Activity's title attribute
#screen_namePage nameTextPackage name.class name of the Activity that the view belongs to
#element_idElement IDTextID of the view. android:id is used by default; you can call setViewID to set it
#element_typeElement typeTextThe type of the control
#element_selectorElement selectorTextConcatenated viewPath of the view
#element_positionElement positionTextPosition of the view; uploaded only when the view has a position attribute
#element_contentElement contentTextThe content on the control
  • Preset properties of the APP crash event (ta_app_crash)
Property nameDisplay nameProperty typeDescription
#app_crashed_reasonException informationTextString. Records the stack trace at the time of the crash

3. Other preset properties​

In addition to the preset properties above, some preset properties are recorded only after you call the corresponding APIs:

Property nameDisplay nameProperty typeDescription

#duration

Event duration

Number

Requires calling the timing function timeEvent. Records how long the event lasts, in seconds

#background_duration

Background duration

NumericRequires calling the timing function timeEvent. Records how long the app stays in the background during the event, in seconds

4. Get preset properties​

In v2.7.0 and later, 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.

//Get the property object
TDPresetProperties presetProperties = TDAnalytics.getPresetProperties();

//Generate event preset properties
JSONObject properties = presetProperties.toEventPresetProperties();
/*
{
"#carrier": "T-Mobile",
"#os": "Android",
"#device_id": "dd4a508df0dbff08",
"#screen_height": 2560,
"#bundle_id": "cn.thinkingdata.android.demo",
"#device_model": "sdk_gphone64_arm64",
"#screen_width": 1440,
"#system_language": "en",
"#install_time": "2022-08-19 17:31:52.398",
"#simulator": true,
"#manufacturer": "Google",
"#os_version": "12",
"#app_version": "1.0",
"#network_type": "3G",
"#zone_offset": 8,
"#ram": "0.8\/1.9",
"#disk": "0.1\/0.8",
"#fps": 60
}
*/

//Get a specific preset property
String bundle_id = presetProperties.bundleId;//Package name
String os = presetProperties.os;//OS type, such as Android
String system_language = presetProperties.systemLanguage;//Phone system language
int screen_width = presetProperties.screenWidth;//Screen width
int screen_height = presetProperties.screenHeight;//Screen height
String device_model = presetProperties.deviceModel;//Device model
String device_id = 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.manufacture;//Phone manufacturer, such as HuaWei
String network_type = presetProperties.networkType;//Network type
String os_version = presetProperties.osVersion;//OS version
String app_version = presetProperties.appVersion;//App version
double zone_offset = presetProperties.zoneOffset;//Time zone offset
String ram = presetProperties.ram;//Memory usage
String disk = presetProperties.disk;//Disk usage
int fps = presetProperties.fps;//fps
String installTime = presetProperties.installTime;//App install time
boolean isSimulator = presetProperties.isSimulator;//Whether the device is a simulator

IP address, country, and city information is parsed and generated on the server side. The client doesn't provide APIs to get these properties

5. Disable preset property collection​

In some scenarios, for compliance or business reasons, you may want to prevent certain preset properties from being collected. You can add a ta_public_config.xml file to the res/values directory of your project to configure an array of the properties whose collection you want to disable.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- ThinkingAnalytics DisablePresetProperties start -->
<string-array name="TDDisPresetProperties">
<!-- <item>#disk</item>-->
<!-- <item>#fps</item>-->
<!-- <item>#ram</item>-->
<!-- <item>#app_version</item>-->
<!-- <item>#os_version</item>-->
<!-- <item>#manufacturer</item>-->
<!-- <item>#device_model</item>-->
<!-- <item>#screen_height</item>-->
<!-- <item>#screen_width</item>-->
<!-- <item>#carrier</item>-->
<!-- <item>#device_id</item>-->
<!-- <item>#system_language</item>-->
<!-- <item>#lib</item>-->
<!-- <item>#lib_version</item>-->
<!-- <item>#os</item>-->
<!-- <item>#bundle_id</item>-->
<!-- <item>#install_time</item>-->
<!-- <item>#start_reason</item>-->
<!-- <item>#simulator</item>-->
<!-- <item>#network_type</item>-->
<!-- <item>#zone_offset</item>-->
<!-- <item>#start_reason</item>-->
<!-- <item>#resume_from_background</item>-->
<!-- <item>#title</item>-->
<!-- <item>#screen_name</item>-->
<!-- <item>#url</item>-->
<!-- <item>#referrer</item>-->
<!-- <item>#element_type</item>-->
<!-- <item>#element_id</item>-->
<!-- <item>#element_position</item>-->
<!-- <item>#element_content</item>-->
<!-- <item>#element_selector</item>-->
<!-- <item>#app_crashed_reason</item>-->
<!-- <item>#background_duration</item>-->
<!-- <item>#duration</item>-->
</string-array>
<!-- ThinkingAnalytics DisablePresetProperties end -->
</resources>

If you block the device ID and need to use first events, make sure you set the first_check_id property

For the Android ID property, we support complete isolation at the code level: after isolation, the app no longer contains any code that gets this property. For details, see Auto-tracking plugin configuration

Was this page helpful?