integrationlatestIntegration / Preset properties
Preset properties
1. Preset properties
Preset properties collected on different platforms vary to some extent. For details, see the following documents: Android platform, iOS platform
2. 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
local presetProperties = TDAnalytics.getPresetProperties()
-- Generate event preset properties
local properties = presetProperties.toEventPresetProperties()
--[[
{
"#carrier": "中国电信",
"#os": "Android",
"#device_id": "abb8e87bfb5ce66c",
"#screen_height": 2264,
"#bundle_id": "com.sw.thinkingdatademo",
"#manufacturer": "realme",
"#device_model": "RMX1991",
"#screen_width": 1080,
"#system_language": "zh",
"#os_version": "10",
"#network_type": "WIFI",
"#zone_offset": 8,
"#app_version":"1.0"
}
]]--
-- Get a specific preset property
local bundleId = presetProperties.bundleId -- Package name
local mOS = presetProperties.os -- OS type, such as Android/iOS
local systemLanguage = presetProperties.systemLanguage -- Phone system language
local screenWidth = presetProperties.screenWidth -- Screen width
local screenHeight = presetProperties.screenHeight -- Screen height
local deviceModel = presetProperties.deviceModel -- Device model
local deviceId = presetProperties.deviceId -- Unique device identifier
local carrier = presetProperties.carrier -- Carrier of the phone's SIM card; on dual-SIM phones, the carrier of the primary SIM card is used
local manufacture = presetProperties.manufacturer -- Phone manufacturer, such as HuaWei
local networkType = presetProperties.networkType -- Network type
local osVersion = presetProperties.osVersion -- OS version
local appVersion = presetProperties.appVersion -- App version
local 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?

