目录
此内容是否有帮助?

# Preset Properties

# 1. Preset Properties of All Events

The following present properties are properties that all events in uni-app SDK (including auto-tracking events) would have.

# 2. Preset Properties of Auto-tracking Event

The following preset properties are the properties set specially for each auto-tracking event

  • Preset properties of mini porgram active(ta_mp_show)
Property name Display name Property type
Instruction
#url_path
page path
Text
The mini program starts the path to the page being displayed
  • Preset properties of mini porgram inactive(ta_mp_hide)
Property name Display name Property type Instruction
#duration
event duration
Numeric value
Indicates the duration between the start of ta_mp_show and the hiding of ta_mp_hide, in seconds
  • Preset properties of mini porgram page display(ta_mp_view)
Property name Display name Property type Instruction
#url_path
page path
Text
The mini program starts the path to the page being displayed
#referrer
forward address
Text
the path of the page before the page is displayed, the path before the jump. If it is the home page displayed when the mini-program is started, the value is "open directly".
  • Preset properties of mini porgram page display(ta_mp_share)
Property name Display name Property type Instruction
#url_path
page path
Text
the path to the page where the mini program is forwarded

# 3.Obtain Preset Properties

You can call getPresetProperties() to obtain preset properties.

When some preset properties of the App side is required for the server-side data tracking, this method can be applied to obtain the preset properties of the App side and then send them to the server.

//obtain property objects
var presetProperties = ta.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"
       }
 */
//obtain a certain preset properties
var os = presetProperties.os; //os type
var osVersion = presetProperties.osVersion; //system version number
var networkType = presetProperties.networkType; //network type
var manufacture = presetProperties.manufacture; //mobile phone manufacturer, e.g., HuaWei
var deviceModel = presetProperties.deviceModel; //device model
var screenWidth = presetProperties.screenWidth; //screen width
var screenHeight = presetProperties.screenHeight; //screen height
var deviceId = presetProperties.deviceId; //unique identifier of device
var zoneOffset = presetProperties.zoneOffset; ////timezone offset value

IP and national city information are parsed and generated by the server. The client side shall not provide the interface to obtain such properties