WeChat 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 | Property Value Example or Description | Trigger Timing | Remarks |
---|---|---|---|---|---|---|---|
$MPLaunch | Mini Program Launch | $scene | Launch Scene | String | Version 1.0 and above. DescriptionThe launch scene of the mini program, the detailed explanation of the scene value can be referred to the official introduction of WeChat Mini Program | It is triggered when the mini program is launched or when the mini program is restarted after being killed by WeChat after running in the background for a certain period of time. Refer to the WeChat official document for more details. | General collection of Mini Program SDK, automatically collected after enabling the autoTrack interface. Refer to the Mini Program SDK:https://manual.sensorsdata.cn/sa/latest/tech_sdk_client_mp_wx-1573892.html UTM advertising campaign parameters used for channel tracking, refer to the documentation: https://manual.sensorsdata.cn/sa/latest/pomote_wechatapplet-7550920.html |
$url_query | URL Parameters | String | Version 1.11.1 and above. Example: pages/index/index?props=a, $url_query is props=a | ||||
$utm_campaign | Ad Campaign Name | String | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_campaign parameter | ||||
$utm_source | Ad Campaign Source | String | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_source parameter | ||||
$utm_medium | Ad Campaign Medium | String | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_medium parameter | ||||
$utm_term | Advertising campaign term | String | Version 0.9 and above. WeChat Mini Program launch Parameters collect if there is utm_term parameter | ||||
$utm_content | Advertising campaign content | String | Version 0.9 and above. WeChat Mini Program launch Parameters collect if there is utm_content parameter | ||||
$is_first_time | Whether it is the first time | Boolean | Version 1.8 or above | ||||
$share_depth | Level of sharing | Numerical value | Version 1.9 or above | ||||
$share_distinct_id | Distinct ID when sharing | String | Version 1.9 and above | ||||
$share_url_path | Page path when sharing | String | Version 1.9 and above | ||||
$share_method | Sharing method | String | Version 1.13.27 and above. Enum values: Moments sharing, Forward message card | ||||
$MPShow | Mini program display | $scene | Launch scene | String | Version 1.0 and above. DescriptionThe launch scene of the mini program, the detailed explanation of the scene value can be referred to the official introduction of WeChat Mini Program | Occurs when the Mini program starts or switches from the background to the foreground. See details in WeChat Official Documentation: Mini Program Startup and Destruction Timing | |
$url_query | Page parameter | Strings | Version 1.11.1 and above. Example: pages/index/index?props=a, $url_query is props=a | ||||
$utm_campaign | Campaign name | Strings | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_campaign parameter | ||||
$utm_source | Campaign source | Strings | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_source parameter | ||||
$utm_medium | Campaign media | Strings | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is utm_medium parameter | ||||
$utm_term | Ad Campaign Keywords | Strings | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is the utm_term parameter | ||||
$utm_content | Ad Campaign Content | Strings | Version 0.9 and above. WeChat Mini Program Launch Parameters collect if there is the utm_content parameter | ||||
$share_depth | Share Depth | Numerical | Version 1.9 and above. | ||||
$share_distinct_id | Distinct ID when Sharing | Strings | Version 1.9 and above. | ||||
$share_url_path | Page Path when Sharing | Strings | Version 1.9 and above | ||||
$share_method | Share Method | String | Version 1.13.27 and above. Enumerated values: Moments Share, Forward Message Card | ||||
$MPHide | Mini Program Background | event_duration | Stay Duration | Number | The time from the current Mini Program display ($MPShow) to entering the background or closing ($MPHide), in seconds; Note: After being stored in the database, the English name of this attribute is $event_duration | Mini Program from foreground to background | |
$MPViewScreen | Mini Program Page Views | $url_query | Page Parameters | String | Version 1.11.1 and above. Example: pages/index/index?props=a, $url_query is props=a | Triggered when opening a mini program page | |
$utm_campaign | Advertising campaign name | String | Version 0.9 and above Collect if the onLoad parameter contains the utm_campaign parameter when the page is loaded | ||||
$utm_source | Advertising campaign source | String | Version 0.9 and above Collect if the onLoad parameter contains the utm_source parameter when the page is loaded | ||||
$utm_medium | Advertising campaign medium | String | Version 0.9 and above Collect if the onLoad parameter contains the utm_medium parameter when the page is loaded | ||||
$utm_term | Advertising campaign term | String | Version 0.9 and above When the page is loaded, if there is a utm_term parameter in the onLoad parameter, it will be collected | ||||
$utm_content | Ad campaign content | String | Version 0.9 and above When the page is loaded, if there is a utm_content parameter in the onLoad parameter, it will be collected | ||||
$MPShare | Mini program share | $share_depth | Level of sharing | Numeric | Version 1.9 and above | After setting the Page.onShareAppMessage function, click the three dots in the upper right corner of the mini program, and then click "Send to friends" to trigger the report | Currently, only the triggering of the user's share can be obtained, and it is unable to listen for feedback on successful sharing |
$share_method | Method of sharing | String | Version 1.13.27 and above, Enumerated values: Moments sharing, Forwarding message card | ||||
$MPClick | Mini Program Element Click | $element_content | Element Content | String |
| Captured when the event handler defined in the Page is triggered. Currently, only tap/ longtap / longpress events are supported; Starting from version 1.14.11, capturing the click event of tab is supported. In this case, $element_type is "tabBar" and $element_content is the text on the tab button;
| |
$element_id | Element ID | String |
| ||||
$element_name | Element Name | String |
| ||||
$element_type | Element type | String |
| ||||
$MPAddFavorites | Mini Program favorites | $url_path | Page path | String | 1.13.27 and above versions | In WeChat, only Android phones have the "Favorites" function, so only Android phones support this event | |
$MPPageLeave | Mini Program page leave | event_duration | Page browsing duration | Number |
| Collected when the onHide or onUnload lifecycle event of a mini-program page is triggered | |
$url_query | Page parameter | String |
|
2. Pre-set property for all events
Property name | Property type | Default display name | Description | Remark |
---|---|---|---|---|
$lib | String | SDK Type | SDK Type | WeChat Mini Program SDK is represented by MiniProgram |
$lib_version | String | SDK Version | SDK Version | |
$lib_method | String | Tracking Method | Tracking method, currently uniformly set to code | |
$app_id | String | Unique identifier of the application | APPID of WeChat Mini Program | 1.13.24 and above versions |
$screen_height | Number | Mini Program Screen Height | Mini Program Screen Height | Before Mini Program SDK version 1.11.1, the field name was "Mini Program Window Height", which refers to the available height of the Mini Program window |
$screen_width | Number | Mini Program Screen Width | Mini Program Screen Width | Before Mini Program SDK version 1.11.1, the field name was "Mini Program Window Width", which refers to the available width of the Mini Program window |
$model | String | Device Model | Directly obtain the value from the corresponding device instead of parsing from UA | |
$manufacturer | String | Device Manufacturer | Supported by Mini Program SDK version 1.11.1 | |
$brand | String | Device Brand | Mini Program SDK version 1.14.10 and above | |
$os | String | Operating System | ||
$os_version | String | Operating System Version | ||
$mp_client_app_version | String | Mini Program Client App Version Number | Version 1.14.29 and above | |
$mp_client_basic_library_version | String | Mini Program Client Basic Library Version Number | Version 1.14.29 and above | |
$is_first_day | Boolean value | Whether the first visit | The value from the first visit of a new user to midnight of the same day is true, and false afterwards. It is stored in the storage cache. Refer to the document New users and first day sign | |
$is_login_id | Boolean value | Whether it is the login ID | Added when the data is stored | |
$longitude | Numeric value | Longitude | GPS information, longitude multiplied by 106, latitude multiplied by 106 | Version 1.13.31 and above |
$latitude | Numeric value | Latitude | ||
$geo_coordinate_system | String | Coordinate system | Collect coordinate information based on the configuration preset_properties.location ; Value:'wgs84' or 'gcj02' | Available starting from Mini Program SDK version 1.14.10; |
$ip | String | IP | Obtained by parsing the HTTP request on the backend | |
$timezone_offset | Numerical value | Timezone offset | System timezone | Version 1.13.24 and above |
$title | String | Page title | Version 1.14.5 and above only collects the $MPViewScreen event, Version 1.14.20 and above adds the $MPPageLeave event collection, Starting from version 1.14.29, all events have this preset property | |
$url | String | Page URL | For example: pages/index/index?props=a | Version 1.14.29 and above |
$url_path | String | Page Path | For example: pages/index/index?props=a. $url_path is pages/index/index | Version 1.14.13 and above |
$referrer | String | Referral URL | Referral page path | 0.9 version onwards, $MPViewScreen is the pre-defined property. Version 1.14.17 and above changed to a pre-set property for all events |
$referrer_title | String | Referral Page Title | Page title configured in the page's JSON | Version 1.14.17 and above |
$country | String | Country | Obtained from IP resolution | |
$province | String | Province | ||
$city | String | City | ||
$network_type | String | Network Type | ||
$browser | String | Browser name obtained by UA parsing | ||
$browser_version | String | Browser version obtained by UA parsing | ||
$app_version | String | Mini program version | Get current account information, only supported in the official version of the mini program, cannot be obtained in the development and trial versions | Version 1.14.29 and above |
$latest_utm_source | String | Last ad campaign source | WeChat Mini Program launch parameter collects data if there is utm_source parameter | Mini program SDK 1.3 version and above support |
$latest_utm_medium | String | Latest advertising campaign medium | WeChat Mini Program launch parameter collects data if there is utm_medium parameter | |
$latest_utm_term | String | Latest advertising campaign keyword | WeChat Mini Program launch parameter collects data if there is utm_term parameter | |
$latest_utm_content | String | Latest advertising campaign content | WeChat Mini Program launch parameter collects data if there is utm_content parameter | |
$latest_utm_campaign | String | Latest advertising campaign name | WeChat Mini Program launch parameter collects data if there is utm_campaign parameter | |
$latest_scene | String | Latest launch scene | Description The scene of the most recent Mini Program launch, see reference to WeChat Mini Program official introduction | Mini Program SDK version 1.9 supports |
$latest_share_distinct_id | String | Latest Sharer | Mini Program SDK version 1.13.21 supports | |
$latest_share_depth | Number | Latest Share Depth | Mini Program SDK version 1.13.21 supports | |
$latest_share_url_path | String | Latest Share URL Path | Mini Program SDK version 1.13.21 supports | |
$latest_share_method | String | Latest Share Method | Mini Program SDK version 1.13.27 and above is supported | |
$bot_name | String | Spider name | Parse from UA |
3. Predefined user property
Property name | Property type | Default display name | Description | Remarks |
---|---|---|---|---|
$first_visit_time | Time | First visit time | This property is assigned a value when a new user first visits the mini program | Because the setting for these properties is performed when a new user first visits the mini program, these properties are generally used to mark user behaviors with anonymous IDs. If the association between the login ID and the anonymous ID fails, the login ID will not have these property values. |
$utm_source | String | First ad campaign source | Use WeChat Mini Program Channel Tracking. User properties will only be collected when new users first access the channel with utm parameters. If a user is an existing user, even if they access the Mini Program through a channel, utm user properties will not be set. Refer to this document for marking new and existing users: New Users and First-day First-time Marking | |
$utm_medium | String | First Campaign Medium | ||
$utm_term | String | First Campaign Keyword | ||
$utm_content | String | First Campaign Content | ||
$utm_campaign | String | First Campaign Name |
4. Preset events and properties for pop-ups
Event variable name in English | Event display name | Property variable name in English | Property display name of the event | Property value type | Attribute Value Example or Description | Trigger Event | Remark |
---|---|---|---|---|---|---|---|
$PlanPopupDisplay | Popup Display | $sf_msg_title | Popup Title | String | |||
$sf_msg_content | Popup Content | String | |||||
$sf_msg_image_url | Image link | String | Image link (image CDN storage address) | Value exists as long as the template has an image | |||
$sf_fail_reason | Failure Reason | String | Records the failure reason of the popup, not collected if the popup is successful | ||||
$sf_succeed | Popup Success | Boolean | |||||
$sf_lib_version | Popup SDK version | String | |||||
$sf_channel_category | Message channel type | String | Value of POPUP constant collected is POPUP | ||||
$sf_channel_service_name | Service provider name | String | Value of SENSORS_FOCUS constant, popup function provided by Sensors Intelligent Operations. Collected value is SENSORS_FOCUS. | ||||
$sf_msg_id | Message ID | String | |||||
$sf_plan_id | Plan ID | String | |||||
$sf_platform_tag | Platform Type Tag | String | The value for mini program popup is MINIPROGRAM | ||||
$sf_plan_strategy_id | Experiment Group ID | String |
| ||||
$sf_audience_id | Audience ID | String | Returned by the server. Not reported by the SDK when the audience is all users | ||||
$sf_plan_type | Plan Type | String | Operational Plan | ||||
$PlanPopupClick | Click Behavior | $sf_plan_id | Plan ID | String | |||
$sf_plan_type | Plan Type | String | Operational Plan | ||||
$sf_channel_service_name | Service Provider Name | String | SENSORS_FOCUS constant, the popup function provided by Sensors Analytics. The value collected is SENSORS_FOCUS | ||||
$sf_channel_category | Message channel type | String | POPUP constant. The value collected is POPUP | ||||
$sf_audience_id | Audience ID | String | Returned by the server, not reported by the SDK when the audience is all users | ||||
$sf_plan_strategy_id | Experiment group ID | String |
| ||||
$sf_msg_title | Push Title | String | |||||
$sf_msg_content | Push Content | String | |||||
$sf_msg_element_type | Pop-up Button Type | String | Types of pop-up elements: ordinary button, text link, image link, close icon, mask layer | ||||
$sf_msg_element_content | Popup button copy | String | Popup button copy | Button-specific | |||
$sf_msg_element_action | Popup button behavior | String | |||||
$sf_msg_image_url | Image link | String | Image link (image CDN storage address) | ||||
$sf_msg_action_id | Click event ID | String | |||||
$sf_platform_tag | End type tag | String | The value of the mini program popup is MINIPROGRAM | ||||
$sf_msg_id | Push message ID | String | |||||
$sf_close_type | Close button type | String | Only closing behaviors include: closing the overlay, closing icon on the top right of the pop-up, closing icon at the bottom of the pop-up, bottom button (set as the button to close the pop-up) | ||||
$sf_lib_version | Pop-up SDK version | String |
5. Predefined events and properties for A/B testing
Event English variable name | Event display name | Property English variable name | Property display name | Property value type | Property value examples or descriptions | Trigger timing | Note |
---|---|---|---|---|---|---|---|
$ABTestTrigger | A/B Testing | $abtest_experiment_group_id | User Group ID | String | Hit the experiment and collect the event and event properties | ||
$abtest_experiment_id | Experiment ID | String |
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.