Web SDK Preset Events and Attributes
Last updated:2023-02-21
Web SDK 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 browser, starts |
| First app activation | jg_app_active | - | Triggered only when the app is launched for the first time. 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 | When UTM parameters are included, the SDK can parse and report them | 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 | When UTM parameters are included, the SDK can parse and report them | |||
| jg_utm_term | Campaign term | string | When UTM parameters are included, the SDK can parse and report them | |||
| jg_utm_content | Campaign content | string | When UTM parameters are included, the SDK can parse and report them | |||
| jg_utm_campaign | Campaign name | string | When UTM parameters are included, the SDK can parse and report them | |||
| Web page view | jg_page_viewscreen | - | Triggered when a web page is opened; depends on automatic tracking | |||
| Web page element click | jg_page_click | - | Triggered when a control is clicked; depends on automatic tracking; Web is not currently supported | |||
Preset Event Attributes
| Display Name | Attribute Name | 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 |
| 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 |
| Device ID | jg_device_id | string | Android mainly uses Android ID; iOS first attempts to obtain IDFA |
| 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 |
| Device model | jg_devices_model | string | Production model of the mobile terminal device |
| Screen height | jg_screen_height | number | |
| Screen width | jg_screen_width | number | |
| Screen size | jg_screen_size | string | |
| Browser name | jg_browser | string | Obtained from UA parsing |
| Browser version | jg_browser_version | string | Obtained from UA parsing |
| Current page title | jg_title | string | Page title |
| Current page URL | jg_url | string | Full page URL |
| Current page path | jg_url_path | string | Content between "/" and "?" in the page URL |
| Page URL domain | jg_url_host | string | Host part of the page URL |
| Referrer domain | jg_referer_fulldomain | string | Host part of jg_referer |
| 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. |
Was this document helpful?