1. Predefined Events

Event Variable NameEvent Display NameProperty Variable NameProperty Display NameProperty Data TypeProperty Value Example or DescriptionTrigger TimingDescriptionCorresponding Lifecycle
$MPLaunchMini Program Launch
$Predefined Properties

This will be triggered when the Mini Program is killed, reopened, and sa.quick('appLaunch', options) is called in the corresponding Mini Program lifecycle function.

This will be triggered once when the Mini Program is initialized.







App.onLaunch
$sceneLaunch sceneString
$url_pathPage pathString
$is_first_timeWhether first timeBoolean
$utm_sourceAdvertisement campaign sourceStringVersion 0.3 and above
$utm_mediumAdvertisement campaign mediumStringVersion 0.3 and above
$utm_termAd Campaign KeywordStringVersion 0.3 and above
$utm_contentAd Campaign ContentStringVersion 0.3 and above
$utm_campaignAd Campaign NameStringVersion 0.3 and above
$MPShowMini Program Display
$predefined_property

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 functionlaunch Mini Program

App.onShow

$scenelaunch scenestring
$url_pathpage pathstring
$utm_sourcecampaign sourceString0.3 or above version
$utm_mediumcampaign mediumString0.3 or above version
$utm_termAdvertising Campaign KeywordsStringVersion 0.3 and above
$utm_contentAdvertising Campaign ContentStringVersion 0.3 and above
$utm_campaignAdvertising Campaign NameStringVersion 0.3 and above
$MPHideMiniprogram Minimizes
$preset_property

Triggers when clicking the exit button on the upper right corner of the mini program, related App goes to the background, entering the about page of the mini program, phone screen locks, or the mini program process is killed and sa.quick('Hide') is called in the corresponding mini program lifecycle function.Miniprogram goes from foreground to backgroundApp.onHide
$event_durationDurationMetricThe time from $MPShow to $MPHide when the Mini Program goes to the background or closes
$url_pathPage PathString


2. Common attributes for all events

Field NameTypeDescriptionRemarks
$libStringSDK TypeThe value of the ByteDance Mini Program SDK is BytedanceMini
$lib_versionStringSDK Version
$app_idStringByteDance Mini Program AppIDNeed to pass appid when initializing SDK with setPara method
$screen_heightNumberScreen height
$screen_widthNumberScreen width
$modelStringDevice model
$manufacturerStringDevice manufacturer
$osStringOperating System
$os_versionStringOperating System Version
$is_first_dayBooleanWhether it is the first day of visit (From the first visit of a new user until midnight between the first day and the next day, it is true. Afterwards, it is false, indicating existence in storage)
$is_login_idBooleanWhether it is a login ID (Judged and added when data is stored)
$ipStringAttribute carried when SDK sends data requests
$timezone_offsetNumericalTimezone OffsetVersion 0.6.0 and above
$countryStringDerived from IP
$provinceStringDerived from IP
$cityStringDerived from IP
$network_typeStringNetwork Type
$browserStringBrowser name parsed from User-Agent
$browser_versionStringBrowser version parsed from User-Agent
$latest_utm_sourceStringLatest paid advertising campaign source0.3 and above versions
$latest_utm_mediumStringLatest paid advertising campaign medium0.3 and above versions
$latest_utm_termStringLatest paid advertising campaign term0.3 and above
$latest_utm_contentStringLast paid advertising campaign content0.3 and above
$latest_utm_campaignStringLast paid advertising campaign name0.3 and above
$latest_sceneStringLast launched scene value0.3 and above