1. Predefined Events

Event English Variable NameEvent Display NameProperty English Variable NameEvent Property Display NameProperty Value TypeProperty Value Example or DescriptionTrigger TimingRemarks
$MPLaunchMini Program Launch$sceneLaunch SceneString

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_queryURL ParametersString

Version 1.11.1 and above.

Example: pages/index/index?props=a, $url_query is props=a

$utm_campaignAd Campaign NameString

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_campaign parameter

$utm_sourceAd Campaign SourceString

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_source parameter

$utm_mediumAd Campaign MediumString

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_medium parameter

$utm_termAdvertising campaign termString

Version 0.9 and above.

WeChat Mini Program launch Parameters collect if there is utm_term parameter

$utm_contentAdvertising campaign contentString

Version 0.9 and above.

WeChat Mini Program launch Parameters collect if there is utm_content parameter

$is_first_timeWhether it is the first timeBooleanVersion 1.8 or above
$share_depthLevel of sharingNumerical valueVersion 1.9 or above
$share_distinct_idDistinct ID when sharingStringVersion 1.9 and above
$share_url_pathPage path when sharingStringVersion 1.9 and above
$share_methodSharing methodStringVersion 1.13.27 and above. Enum values: Moments sharing, Forward message card
$MPShowMini program display$sceneLaunch sceneString

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_queryPage parameterStrings

Version 1.11.1 and above.

Example: pages/index/index?props=a, $url_query is props=a

$utm_campaignCampaign nameStrings

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_campaign parameter

$utm_sourceCampaign sourceStrings

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_source parameter

$utm_mediumCampaign mediaStrings

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is utm_medium parameter

$utm_termAd Campaign KeywordsStrings

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is the utm_term parameter

$utm_contentAd Campaign ContentStrings

Version 0.9 and above.

WeChat Mini Program Launch Parameters collect if there is the utm_content parameter

$share_depthShare DepthNumericalVersion 1.9 and above.
$share_distinct_idDistinct ID when SharingStringsVersion 1.9 and above.
$share_url_pathPage Path when SharingStringsVersion 1.9 and above
$share_methodShare MethodStringVersion 1.13.27 and above. Enumerated values: Moments Share, Forward Message Card
$MPHideMini Program Backgroundevent_durationStay DurationNumber

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
$MPViewScreenMini Program Page Views$url_queryPage ParametersString

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_campaignAdvertising campaign nameString

Version 0.9 and above

Collect if the onLoad parameter contains the utm_campaign parameter when the page is loaded

$utm_sourceAdvertising campaign sourceString

Version 0.9 and above

Collect if the onLoad parameter contains the utm_source parameter when the page is loaded

$utm_mediumAdvertising campaign mediumString

Version 0.9 and above

Collect if the onLoad parameter contains the utm_medium parameter when the page is loaded

$utm_termAdvertising campaign termString

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_contentAd campaign contentString

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

$MPShareMini program share$share_depthLevel of sharingNumericVersion 1.9 and aboveAfter 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 reportCurrently, only the triggering of the user's share can be obtained, and it is unable to listen for feedback on successful sharing
$share_methodMethod of sharingStringVersion 1.13.27 and above, Enumerated values: Moments sharing, Forwarding message card
$MPClickMini Program Element Click

$element_contentElement ContentString
  • Version 1.13.18 and above, the data-content attribute needs to be set on the component in order to collect it. If not set, this attribute will not be collected. For example: <view bindtap="test" data-content="testContent">Test</view>
  • Taro framework version 3.0 does not support

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_idElement IDString
  • Version 1.13.18 and above, used to distinguish components. The id attribute needs to be set on the component in order to collect it. If not set, this attribute will not be collected. For example: <view bindtap="test" id="testID">Test</view>
$element_nameElement NameString
  • 1.13.18 and above versions, used to distinguish components, need to set data-name attribute on the component to collect it, the attribute cannot be collected if not set. For example: <view bindtap="test" data-name="testName">Test</view>
  • Taro framework version 3.0 is not supported
$element_typeElement typeString
  • 1.13.18 and above versions, need to set data-type attribute on the component to collect it, the attribute cannot be collected if not set. For example: <view bindtap="test" data-type="testType">Test</view>
  • Taro framework version 3.0 is not supported
$MPAddFavoritesMini Program favorites$url_pathPage pathString1.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_durationPage browsing durationNumber
  • 1.14.20 and above versions, unit: seconds
  • The interval duration from the lifecycle event onShow to onHide or onUnload
  • Note: The English name for this attribute after being stored is $event_duration


Collected when the onHide or onUnload lifecycle event of a mini-program page is triggered
$url_queryPage parameterString
  • 1.14.20 and above versions. For example, pages/index/index?props=a, $url_query is props=a

2. Pre-set property for all events

Property nameProperty typeDefault display nameDescriptionRemark
$libStringSDK TypeSDK TypeWeChat Mini Program SDK is represented by MiniProgram
$lib_versionStringSDK VersionSDK Version
$lib_methodStringTracking MethodTracking method, currently uniformly set to code
$app_idStringUnique identifier of the applicationAPPID of WeChat Mini Program1.13.24 and above versions
$screen_heightNumberMini Program Screen HeightMini Program Screen HeightBefore 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_widthNumberMini Program Screen WidthMini Program Screen WidthBefore 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
$modelStringDevice Model

Directly obtain the value from the corresponding device instead of parsing from UA


$manufacturerStringDevice ManufacturerSupported by Mini Program SDK version 1.11.1
$brandStringDevice BrandMini Program SDK version 1.14.10 and above
$osStringOperating System
$os_versionStringOperating System Version
$mp_client_app_versionStringMini Program Client App Version NumberVersion 1.14.29 and above
$mp_client_basic_library_versionStringMini Program Client Basic Library Version NumberVersion 1.14.29 and above
$is_first_dayBoolean valueWhether the first visitThe 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_idBoolean valueWhether it is the login IDAdded when the data is stored
$longitudeNumeric valueLongitudeGPS information, longitude multiplied by 106, latitude multiplied by 106Version 1.13.31 and above
$latitudeNumeric valueLatitude
$geo_coordinate_systemStringCoordinate 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;

$ipStringIPObtained by parsing the HTTP request on the backend
$timezone_offsetNumerical valueTimezone offsetSystem timezoneVersion 1.13.24 and above
$titleStringPage 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

$urlStringPage URLFor example: pages/index/index?props=aVersion 1.14.29 and above
$url_pathStringPage PathFor example: pages/index/index?props=a. $url_path is pages/index/indexVersion 1.14.13 and above
$referrerStringReferral URLReferral page path0.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_titleStringReferral Page TitlePage title configured in the page's JSONVersion 1.14.17 and above
$countryStringCountry

Obtained from IP resolution


$provinceStringProvince
$cityStringCity
$network_typeStringNetwork Type

$browserStringBrowser name obtained by UA parsing

$browser_versionStringBrowser version obtained by UA parsing

$app_versionStringMini program versionGet current account information, only supported in the official version of the mini program, cannot be obtained in the development and trial versionsVersion 1.14.29 and above
$latest_utm_sourceStringLast 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_mediumStringLatest advertising campaign mediumWeChat Mini Program launch parameter collects data if there is utm_medium parameter
$latest_utm_termStringLatest advertising campaign keywordWeChat Mini Program launch parameter collects data if there is utm_term parameter
$latest_utm_contentStringLatest advertising campaign contentWeChat Mini Program launch parameter collects data if there is utm_content parameter
$latest_utm_campaignStringLatest advertising campaign nameWeChat Mini Program launch parameter collects data if there is utm_campaign parameter
$latest_sceneStringLatest launch sceneDescription The scene of the most recent Mini Program launch, see reference to  WeChat Mini Program official introductionMini Program SDK version 1.9 supports
$latest_share_distinct_idStringLatest Sharer
Mini Program SDK version 1.13.21 supports
$latest_share_depthNumberLatest Share Depth
Mini Program SDK version 1.13.21 supports
$latest_share_url_pathStringLatest Share URL Path
Mini Program SDK version 1.13.21 supports
$latest_share_methodStringLatest Share Method
Mini Program SDK version 1.13.27 and above is supported
$bot_nameStringSpider nameParse from UA

3. Predefined user property

Property nameProperty typeDefault display nameDescriptionRemarks
$first_visit_timeTimeFirst visit timeThis property is assigned a value when a new user first visits the mini programBecause 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_sourceStringFirst 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_mediumStringFirst Campaign Medium
$utm_termStringFirst Campaign Keyword
$utm_contentStringFirst Campaign Content
$utm_campaignStringFirst Campaign Name


4. Preset events and properties for pop-ups

Event variable name in EnglishEvent display nameProperty variable name in EnglishProperty display name of the eventProperty value typeAttribute Value Example or DescriptionTrigger EventRemark
$PlanPopupDisplay

Popup Display$sf_msg_titlePopup TitleString


$sf_msg_contentPopup ContentString


$sf_msg_image_urlImage linkStringImage link (image CDN storage address)
Value exists as long as the template has an image
$sf_fail_reasonFailure ReasonString

Records the failure reason of the popup, not collected if the popup is successful
$sf_succeedPopup SuccessBoolean


$sf_lib_versionPopup SDK versionString


$sf_channel_categoryMessage channel typeStringValue of POPUP constant collected is POPUP

$sf_channel_service_nameService provider nameString

Value of SENSORS_FOCUS constant, popup function provided by Sensors Intelligent Operations. Collected value is SENSORS_FOCUS.



$sf_msg_idMessage IDString


$sf_plan_idPlan IDString


$sf_platform_tagPlatform Type TagStringThe value for mini program popup is MINIPROGRAM

$sf_plan_strategy_idExperiment Group IDString
  • -1, Control Group
  • 0, Strategy Group


$sf_audience_idAudience IDString

Returned by the server. Not reported by the SDK when the audience is all users
$sf_plan_typePlan TypeStringOperational Plan

$PlanPopupClick

Click Behavior$sf_plan_idPlan IDString


$sf_plan_typePlan TypeStringOperational Plan

$sf_channel_service_nameService Provider NameStringSENSORS_FOCUS constant, the popup function provided by Sensors Analytics. The value collected is SENSORS_FOCUS

$sf_channel_categoryMessage channel typeStringPOPUP constant. The value collected is POPUP

$sf_audience_idAudience IDString

Returned by the server, not reported by the SDK when the audience is all users
$sf_plan_strategy_idExperiment group IDString
  • -1, control group
  • 0, strategy group


$sf_msg_titlePush TitleString


$sf_msg_contentPush ContentString


$sf_msg_element_typePop-up Button TypeStringTypes of pop-up elements: ordinary button, text link, image link, close icon, mask layer

$sf_msg_element_contentPopup button copyStringPopup button copy
Button-specific
$sf_msg_element_actionPopup button behaviorString


$sf_msg_image_urlImage linkStringImage link (image CDN storage address)

$sf_msg_action_idClick event IDString


$sf_platform_tagEnd type tagStringThe value of the mini program popup is MINIPROGRAM

$sf_msg_idPush message IDString


$sf_close_typeClose button typeString

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_versionPop-up SDK versionString


5. Predefined events and properties for A/B testing

Event English variable nameEvent display nameProperty English variable nameProperty display nameProperty value typeProperty value examples or descriptionsTrigger timingNote
$ABTestTrigger

A/B Testing$abtest_experiment_group_idUser Group IDString
Hit the experiment and collect the event and event properties
$abtest_experiment_idExperiment IDString