Skip to main content

Preset properties

Last updated 08/27/2026

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 nameDisplay nameProperty typeDescription

#ip

IP addressTextThe user's IP address, which AE uses to get the user's geographic location
#countryCountryTextThe user's country, generated from the IP address
#country_codeCountry codeTextThe country code of the user's country (ISO 3166-1 alpha-2, that is, two uppercase letters), generated from the IP address
#provinceProvinceTextThe user's province, generated from the IP address
#cityCityTextThe user's city, generated from the IP address
#device_modelDevice modelTextModel of the user's device, such as iPhone 8
#device_idDevice IDTextThe user's device ID, which is the UUID generated during initialization
#screen_heightScreen heightNumericScreen height of the user's device, such as 1920
#screen_widthScreen widthNumericScreen height of the user's device, such as 1080
#manufacturerDevice manufacturerTextManufacturer of the user's device, such as Apple and vivo
#os_versionOS VersionTextiOS 11.2.2, Android 8.0.0, etc.
#osOSTextSuch as Android and iOS
#network_typeNetwork statusTextNetwork status when the event is uploaded, such as WIFI, 3G, and 4G
#libSDK typeTextThe type of SDK you integrated, such as MP (mini program) and MG (mini game)
#lib_versionSDK versionTextThe version of the SDK you integrated
#sceneScene valueNumericThe scene value passed in when the mini program or mini game launches
#mp_platformMini program platformTextIdentifies the platform where the app runs
#zone_offset

Time Zone Offset

NumericOffset in hours of the data time relative to UTC
#system_languageSystem languageTextSystem 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 nameDisplay nameProperty typeDescription
#url_pathPage pathTextPath of the page displayed when the mini program launches

#start_reason

Launch reasonTextA JSON string; the parameter obtained from the getLaunchOptionsSync API
  • Preset properties of mini program hide (ta_mp_hide)
Property nameDisplay nameProperty typeDescription
#duration

Event duration

NumericThe 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 nameDisplay nameProperty typeDescription
#url_pathPage pathTextPage path, that is, the path of the displayed page
#referrerReferrer pathTextPath 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 nameDisplay nameProperty typeDescription
#url_pathPage pathTextPath 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?