Baidu Mini Program SDK Predefined Events and Properties
|
Collect
1. Predefined Events
Event English Variable Name | Event Display Name | Property English Variable Name | Event Property Display Name | Property Value Type | Trigger Time | Description | Remarks |
---|---|---|---|---|---|---|---|
$MPLaunch | Mini Program Launch | $Preset Properties | When the Mini Program is killed and reopened, and sa.quick('appLaunch', options) is called in the corresponding Mini Program lifecycle function, it will be triggered. | Triggered only once when the Mini Program is initialized | |||
$scene | Launch Scene | String | |||||
$url_path | Page Path | String | |||||
$is_first_time | Is First Time | Boolean | |||||
$utm_source | String | Advertising Campaign Source | |||||
$utm_medium | String | Advertising Campaign Medium | |||||
$utm_term | String | Advertising Campaign Term | |||||
$utm_content | String | Advertising Campaign Content | |||||
$utm_campaign | String | Advertising Campaign Name | |||||
$MPShow | Mini Program Display | $Preset Properties | When the mini program is launched, or when it is brought to the foreground from the background and sa.quick('appShow', options) is called in the corresponding mini program lifecycle function. | When the mini program is launched | |||
$scene | Launch Scene | String | |||||
$url_path | Page Path | String | |||||
$utm_source | String | Advertising Campaign Source | |||||
$utm_medium | String | Advertising Campaign Media | |||||
$utm_term | String | Advertising Campaign Keyword | |||||
$utm_content | String | Advertising Campaign Content | |||||
$utm_campaign | String | Advertising Campaign Name | |||||
$MPHide | Miniprogram to Background | $Preset Properties | When user exits the mini program by clicking the upper-right corner exit button, switching to another App, entering the about page, locking screen, or the mini program process is killed and sa.quick('Hide') is called in the corresponding mini program lifecycle function, | Miniprogram from Foreground to Background | |||
$event_duration | Duration on page | Value | |||||
$url_path | Page path | String | |||||
$MPViewScreen | Mini program page view | $Preset Properties | Triggered when a mini program is launched, a page is opened within a mini program, or when the app is brought to the foreground from the background | Called each time a page is opened | Not supported for mini programs developed with the uni-app framework Supported from version v0.6.0 and later | ||
$url_path | Page path | String | |||||
$MPClick | Mini program element click | $Preset Properties | Triggered when a Mini Program page element is clicked | Only collected when the element being clicked has added listeners using bindtap/bindlongtap/bindlongpress | |||
$element_id | Element ID | String | |||||
$element_name | Element Name | String | |||||
$element_content | Element Content | String | |||||
$element_type | Element Type | String | |||||
$url_path | Page Path | String |
2. Predefined attribute for all events
Field Name | Type | Description | Remark |
---|---|---|---|
$lib | String | SDK Type | The value for Baidu Mini Program SDK is SmartProgram |
$lib_version | String | SDK Version | |
$app_id | String | AppID of Baidu Mini Program (Smart Mini Program ID) | Supported from version 0.8.0 and above |
$screen_height | Numeric | Screen Height | |
$screen_width | Numeric | Screen width | |
$model | String | Device model | |
$manufacturer | String | Device manufacturer | |
$os | String | Operating system | |
$os_version | String | Operating system version | |
$is_first_day | Boolean Value | Whether it is the first day of visit (true for values between the first visit of new users and midnight on that day, false afterwards, indicating it exists in storage) | |
$is_login_id | Boolean Value | Whether it is the login ID (determined and added when data is stored) | |
$ip | String | Attribute carried when SDK sends data request | |
$timezone_offset | Number | Timezone offset | Supported in version 0.8.0 and above |
$country | String | Obtained by IP resolution | |
$province | String | Obtained from IP resolution | |
$city | String | Obtained from IP resolution | |
$network_type | String | Network type | |
$browser | String | Browser name | |
$browser_version | String | Browser version | |
$latest_utm_source | string | The latest source of the last paid advertising campaign, taken from the last source value with a value. | |
$latest_utm_medium | string | The latest medium of the last paid advertising campaign, taken from the last medium value with a value. | |
$latest_utm_term | string | The latest term of the last paid advertising campaign, taken from the last term value with a value. | |
$latest_utm_content | string | The latest content of the last paid advertising campaign, taken from the last content value with a value. | |
$latest_utm_campaign | string | The latest campaign name of the last paid advertising campaign, taken from the last campaign name value with a value. | |
$latest_scene | String | Latest launch scene value |
3. Predefined user attribute
Attribute name | Attribute type | Default display name | Description | Remark |
---|---|---|---|---|
$first_visit_time | Time | First visit time | Assigned when a new user visits the mini program for the first time | Because the settings of these attributes are only applied to new users when they first visit the mini program, new users are generally identified by anonymous ID to track their behaviors. If the association between login ID and anonymous ID fails, the login ID will not have values from these attributes. |
$utm_source | String | First ad campaign source | These user attributes are collected only when using the mini program channel tracking and when new users access the program through channels with utm parameters for the first time. Existing users will not have these attributes even if they access the program through channels. For marking new and existing users, please refer to this document: New User and First-Day First-Time Marking | |
$utm_medium | String | First Advertising Campaign Medium | ||
$utm_term | String | First Advertising Campaign Keyword | ||
$utm_content | String | First Advertising Campaign Content | ||
$utm_campaign | String | First Advertising Campaign Name |
Note: The content of this document is a technical document that provides details on how to use the Sensors product and does not include sales terms; the specific content of enterprise procurement products and technical services shall be subject to the commercial procurement contract.