WeChat Mini Program Preset Events and Attributes

Last updated:2023-02-21
WeChat Mini Program Preset Events and Attributes

Based on common usage scenarios and to help developers quickly integrate the SDK, the Jiguang Analytics SDK predefines some basic events and attributes. Developers do not need to manually add tracking points; the SDK automatically collects and reports them.
Preset events and preset attributes start with jg_, making them easy to distinguish from custom events and attributes.

Preset Events

  • All preset events include basic preset attributes. For details, see Preset Event Attributes.
  • "-" means that the event has only basic preset attributes.
Event Display Name Event Name Event Attribute Attribute Display Name Data Type Attribute Value Meaning or Example & Sample Format Event Trigger Timing
App launch jg_app_launch jg_query Page parameters string Content after "?" in the page URL Reported when the app, here referring to the mini program, starts
First app activation jg_app_active - Triggered only when the app is opened for the first time after installation. It will not be triggered again on the second opening.
App switches to background jg_app_hide - The app switches from foreground active state to background
App switches to foreground jg_app_show - The app switches from background to foreground active state
Exit app jg_app_end - Triggered when exiting the app or when the app enters the background
New user registration jg_app_cuid jg_utm_source Campaign source string Depends on developers setting public attributes; otherwise there is no data Triggered when a new user registers successfully. The backend also triggers setting user attributes: first visit time and the first_utm series.
jg_utm_medium Campaign medium string Depends on developers setting public attributes; otherwise there is no data
jg_utm_term Campaign term string Depends on developers setting public attributes; otherwise there is no data
jg_utm_content Campaign content string Depends on developers setting public attributes; otherwise there is no data
jg_utm_campaign Campaign name string Depends on developers setting public attributes; otherwise there is no data
Mini program page view jg_mp_viewscreen - Triggered when a mini program page is opened; depends on automatic tracking; currently not supported
Mini program page element click jg_mp_click - Triggered when a control is clicked; depends on automatic tracking; currently not supported
Mini program share jg_app_share - Triggered when sharing; depends on automatic tracking; currently not supported
Mini program favorite jg_app_addfavorites - Triggered when favoriting; depends on automatic tracking; currently not supported

Preset Event Attributes

Display Name Attribute Name Data Type Remarks
Data source type jg_data_source string Android, iOS, WebJS, WeChat Mini Program, WeChat Official Account, HTTP API
app_key jg_app_key string appkey registered for Android, iOS, Web, mini program, etc. in Platform -> Data Source
App name jg_app_name string Android and iOS are handled by the SDK; WebJS, mini program, and official account are handled by the backend
Data source ID jg_data_source_id number Data source ID registered for Android, iOS, Web, mini program, etc. in Platform -> Data Source
WeChat APPID jg_wechat_appid string Unique application identifier ID in the WeChat ecosystem, such as WeChat Mini Program and WeChat Official Account
App channel jg_channel_source string 360, Tencent MyApp, Wandoujia, Huawei AppGallery
First launch jg_launch_first bool First launch after installing the app
First-day visit jg_is_first_day bool Whether the event is triggered on the first day. From first launch to 24:00 on that day is considered the first day.
Platform type jg_platform_type string App, web page, mini program, WeChat Official Account
Jiguang Analytics SDK version jg_operate_sdk_ver string Jiguang Analytics SDK version number
Mini program base library version jg_mp_so_version string Mini program client base library version number
Device ID jg_device_id string Android mainly uses Android ID; iOS first attempts to obtain IDFA
Mobile carrier jg_carrier string China Telecom, China Mobile, China Unicom
Uses Wi-Fi jg_wifi bool Whether Wi-Fi is used for networking
Network type jg_network_type string Wi-Fi, 2G, 3G, 4G, 5G
IP address jg_ip string Must be obtained by the backend service
Country jg_country string Country parsed from IP address
City jg_city string City parsed from IP address
Province jg_province string Province parsed from IP address
GPS latitude jg_latitude number WeChat Official Account Latitude
GPS longitude jg_longitude number WeChat Official Account Longitude
Device brand jg_brand string huawei, xiaomi, vivo, oppo, apple
Device manufacturer jg_manufacturer string huawei, xiaomi, vivo, oppo, apple
Device model jg_devices_model string Production model of the mobile terminal device
Device time zone jg_time_zone string Current time zone of the device terminal system
System language jg_os_language string Current language of the device terminal system
Operating system jg_os string iOS, Android, HarmonyOS, Windows, Linux
System version jg_os_version string Android 7, iOS 14.5
Screen height jg_screen_height number
Screen width jg_screen_width number
Screen size jg_screen_size string
Current page URL jg_url string Full page URL
Current page path jg_url_path string Content between "/" and "?" in the page URL
Referrer domain jg_referer_fulldomain string Host part of jg_referer
Referrer type jg_referer_type string
Referrer page URL jg_referer_url string URL information of the previous page. For WeChat Mini Program, this is the jg_url_path of the previous page.
Session duration jg_event_duration number Calculated by summing the duration that the device stays in the foreground, in seconds. This attribute is not present in app_launch or has a value of 0.
Launch scene jg_scene string Describes the most recent mini program launch scene. For scene value descriptions, see the official WeChat Mini Program introduction.
Was this document helpful?

Copyright 2011-2026, jiguang.cn, All Rights Reserved. 粤ICP备12056275号-13 Shenzhen Hexun Huagu Information Technology Co., Ltd.

Open in Docs Center