Web JS SDK Preset Events and Preset Properties
|
Collect
1. Preset 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 |
---|---|---|---|---|---|---|---|
$pageview | Web Browsing Page | $preset_properties | Automatically collected when a page is opened, reported based on the triggering of autoTrack, the triggering timing can be customized, it is generally recommended to be executed immediately after initializing the SensorsData SDK. | JS SDK general collection, it will be automatically collected after opening the autoTrack interface, reference documentation: JS SDK https://www.sensorsdata.cn/manual/js_sdk.html UTM advertising campaign parameters, which can be used for channel tracking, reference documentation: https://manual.sensorsdata.cn/sa/latest/channel_tracking-22258121.html | |||
$is_first_time | Is First Time | Boolean Value | When a new user visits a page for the first time, the first $pageview event triggered has the value of true, and subsequent $pageview events have the value of false. | ||||
$url_path | Page path | String | |||||
$referrer_host | Referring domain | String | If the page is opened directly, the value is an empty string | ||||
$referrer | Referring address | String | If the page is opened directly, the value is an empty string | ||||
$utm_campaign | Advertising campaign name | String | Collected if the opened page has this parameter in the URL | ||||
$utm_source | Advertising campaign source | String | If the url opened by the user has this parameter, it will be collected | ||||
$utm_medium | Advertising campaign medium | String | If the URL of the page being opened has this parameter, it will be collected | ||||
$utm_term | Advertising campaign term | String | If the URL of the page being opened has this parameter, it will be collected | ||||
$utm_content | Advertising campaign content | String | If the URL of the page being opened has this parameter, it will be collected | ||||
$WebClick | Web element click | $predefined_property | Automatic collection when clicking an element/control/button (expandable) | JS SDK universal collection, automatic collection when opening the autoTrack interface, see documentation: Full Tracking (Web) | |||
$element_id | Element ID | String | Elements are only collected if they have an id attribute | ||||
$element_content | Element content | String | Text between element tags directly, for example: <a><span>Submit</span></a>, the collected value is "Submit" | ||||
$element_name | Element name | String | Elements are only collected if they have a name attribute | ||||
$element_class_name | Element class name | String | Elements are only collected if they have a class attribute | ||||
$element_type | Element type | String | Default collection | ||||
$element_selector | Element selector | String | Default collection | ||||
$element_target_url | Element link address | String | Default collection for "a" tags | ||||
$url_path | Page path | String | |||||
$element_path | DOM tree structure node after the body | String | Default collection. The element is taken from the nearest root path with an id, and if none of the root paths have an id, it takes the concatenation of all paths with '>' in between. If the element has an id name, '#' is added after the element type. | ||||
$element_position | Element Leaf Node Index | String | The li label of the page and the child labels in the li label (that is, the leaf node is the li label or the parent node of the leaf node or the parent node is the li label) are collected. | ||||
$page_x | Click the distance to the left of the page | Numerical value | Version 1.21.5 starts collecting $page_x and $page_y. | ||||
$page_y | Click the distance from the top of the page | Numerical value | |||||
$WebStay | Web view area stay | $Preset properties | Effective stay: focus on the page area does not scroll, during which the mouse can move, click and other operations. Valid residence time: The residence time exceeds the specified time, which is 4 seconds by default in the javascript sdk (parameters can be set). The javascript sdk sends a page stay event if a page scroll occurs and the previous page stay is valid, that is, longer than the default 4 seconds or a custom time. | This event needs to be captured in order to use the thermal map-reachability diagram function of the Sensors Analytics. Event trigger condition: Stay on a page for more than 4 seconds and make an effective swipe to trigger. Adding custom attributes is not supported | |||
$viewport_width | Visual width | Numerical value | Viewport Width (The width of the current browser's viewport, measured in pixels.) | ||||
$viewport_position | Viewport Position from Top | Numeric | Viewport Position from Top (The position of the current scroll bar, measured from the top of the page, in pixels.) | ||||
$viewport_height | Viewport Height | Numeric | Viewport Height (The height of the current browser's viewport, measured in pixels.) | ||||
$event_duration | Event Duration | Numeric | Time interval since the last trigger of the scroll event. If there is no action on the page, the event is triggered once every 4 seconds when scrolling the page. If there is scrolling on the page, the duration is reset to zero. | ||||
$url_path | Page Path | String | |||||
$WebPageLeave | Web Page Browsing Duration | $Preset attribute | The "active state switch" of the page (losing focus/gaining focus, switching window minimization, switching browser tab, computer sleep and wake up) and "leave" (closing window, page jump, refresh, browser forward and backward) trigger the $WebPageLeave event in the lifecycle, where event_duration refers to the duration of page browsing. | See detailed configuration | |||
$url_path | Page path | String | |||||
$referrer_host | Forward domain name | String | If the page is opened directly, the value is an empty string. | ||||
$referrer | Forward address | String | If the page is opened directly, the value is an empty string. | ||||
$event_duration | Browsing duration | Numeric | User browsing duration, in seconds | ||||
$viewport_position | Position of the viewport from the top | Value | Collected starting from version 1.21.5. Position of the viewport from the top (current scroll position, height from the top of the page, in pixels.) | Supported since version 1.21.5 | |||
$WebPageLoad | Web page load time | $PredefinedProperties | Calculates the page load time using the performance API, listens for the page to finish loading, and triggers the $WebPageLoad event. | See detailed configuration | |||
$url_path | Page path | String | |||||
$referrer_host | Referring domain | String | If the page is directly opened, the value is an empty string | ||||
$referrer | Referring URL | String | If the page is directly opened, the value is an empty string | ||||
$event_duration | Event duration | Number | Page loading duration in seconds | ||||
$page_resource_size | Page resource size | Number | Starting from version 1.21.7, the page resource size is collected in kilobytes (kb). The size should be greater than 0 and less than 10GB. If it does not meet the requirements, it will not be collected. |
2. Default attributes for all events
Attribute name | Attribute type | Default display name | Description | Notes |
---|---|---|---|---|
$lib | String | SDK Type | SDK Type | |
$lib_version | String | SDK Version | SDK Version | |
$lib_method | String | Tracking Method | Tracking Method, currently the value is unified as "code" | |
$screen_height | Number | Screen Height | Screen Height, collected in pixels | |
$screen_width | Numeric | Screen Width | Screen width, measured in pixels | |
$url_host | String | Page address domain | Parsed by the server. If $url is reported in the event, this property will be parsed from it | |
$is_first_day | Boolean | Whether it is the first day of visit | Indicates whether it is the first day an event is triggered. Please refer to New User and First Day First Time Marking | Supported in version 1.5 |
$is_login_id | Boolean | Whether it is a login ID | Determined during data storage | |
$ip | String | IP | Backend parsing from HTTP request | |
$timezone_offset | Number | Timezone offset | Obtained directly from the browser's time object | Supported in version 1.15.9 |
$country | String | Country | Resolved from IP | |
$province | String | Province | ||
$city | String | City | ||
$latest_referrer | String | Last external address | Reset as long as the forward domain is not the current page domain | Supported in version 1.6 |
$latest_referrer_host | String | Last external domain | Version 1.14.8 and above, not collected by default, need to be manually set preset_properties Detailed configuration reference | Supported in version 1.6 |
$latest_landing_page | String | Last landing page | ||
$latest_utm_source | String | Last ad campaign source | After using Web Channel Track , once the URL contains corresponding channel information (utm_ parameters), it will be reset. | Version 1.6 is supported. |
$latest_utm_term | String | Latest ad campaign term | ||
$latest_utm_content | String | Latest ad campaign content | ||
$latest_utm_campaign | String | Latest ad campaign name | ||
$latest_utm_medium | String | Latest ad campaign medium | ||
$latest_search_keyword | String | Search engine keyword | Due to different strategies implemented by various search engines, there might be cases in which the keyword cannot be acquired. | Supported in version 1.8 |
$latest_traffic_source_type | String | Latest Traffic Source Type | Refer to the document for the value rule Explanation of Traffic Source Type | Supported in version 1.8 |
$url | String | Page URL | In version 1.16.5, $title and $url are set as properties for all events | |
$title | String | Page Title | ||
$viewport_width | Number | Viewport Width | Viewport Width (The width of the visible area of the current browser, in pixels) | In version 1.21.5, $viewport_width and $viewport_height are set as properties for all events |
$viewport_height | Numeric | Viewport Height | Viewport Height (the height of the visible area of the current browser, in pixels.) | |
$page_height | Numeric | Page Height | Version 1.21.5 integrated Page Height Plugin will collect this property. |
Note:
(1) The search engine keyword, $latest_search_keyword, may not be collected due to different strategies of each search engine.
(2) The attribute value of $latest_traffic_source_type includes: paid advertising traffic, organic search traffic, social media traffic, referral traffic, direct traffic.
(3) The latest paid advertising related parameters are event attributes and do not need to be configured. They will exist in all events. This attribute will save the most recent valid utm_source.
3. Preset properties related to UserAgent
These properties are parsed from the UserAgent of the browser.
Field Name | Type | Description | SDK Version |
---|---|---|---|
$manufacturer | String | Device Manufacturer | v1.6 and above support new parsing method |
$model | string | device model | |
$os | string | operating system | |
$os_version | string | operating system version | |
$browser | string | browser name | |
$browser_version | string | browser version | |
$bot_name | String | Spider Name |
Currently, it is determined by UA and has a default property $bot_name (Spider Name). However, there are two situations that cannot be determined:
Firstly, if the UA does not indicate and the illegal spider triggers JS scripts.
Secondly, if the spider does not trigger JS scripts, it will not trigger our SDK, so it won't be counted in the statistics.
For spider types, the parsing of mainstream spider names is already supported. However, for newly added or other niche types of spiders, there may be cases where they cannot be parsed.
4. Preset User Properties
Property Name | Property Type | Default Display Name | Description | Remarks |
---|---|---|---|---|
$first_visit_time | Time | First Visit Time | When a new user first visits the webpage, this property will be assigned a value. | Because the setting time of these properties is when a new user first visits the webpage, these properties will only be set for new users who are generally identified by anonymous ID for user behavior tracking. 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 Campaign Source | Use Web Channel Track and collect these user attributes only when new users visit for the first time through the channel with utm parameters. Even if old users access the webpage through the channel, these user attributes will not be set. The marking of new and old users can be referred to in this document: New Users and First-day First-time Mark | |
$utm_medium | String | First Campaign Medium | ||
$utm_term | String | First Campaign Term | ||
$utm_content | String | First Campaign Content | ||
$utm_campaign | String | First Campaign Name | ||
$first_referrer | String | First Referrer | The forward address when a new user first comes to the page with the Sensors Analytics SDK. | |
$first_referrer_host | String | First Forward Domain Name | The forward page domain name when the user uses the SDK for the first time | |
$first_browser_language | String | First used browser language | The browser language when the new user first visits the SDK page | |
$first_browser_charset | String | First used browser character set | SDK 1.8 and above supported, the browser character set when the new user first visits the SDK page | |
$first_search_keyword | String | First search engine keyword | SDK 1.8 and above supported | |
$first_traffic_source_type | String | First traffic source type | SDK 1.8 and above supported, the attribute values include: paid advertising traffic, organic search traffic, social media traffic, referral traffic, direct traffic. |
5. Channel Tracking Related Predefined Events and Predefined Properties
Event English Name | Event Display Name | Property English Name | Property Display Name | Property Value Type | Description | Trigger Occasion |
---|---|---|---|---|---|---|
$ChannelLinkReaching | Channel Link Reaching | $Predefined Properties | When users click on a channel link to reach the landing page, this event and event properties will be collected. | |||
$first_channel_keyword_id | First Channel Keyword ID | String | First Channel Keyword ID | |||
$channel_keyword_id | Channel Keyword ID | String | Channel Keyword ID |
6. Preset Events and Properties for A/B Testing
Event English Name | Event Display Name | Property English Name | Property Display Name | Property Value Type | Description | Trigger Timing |
---|---|---|---|---|---|---|
$ABTestTrigger | A/B Testing | $Preset Attribute | Hit experiment and collect this event as well as event properties | |||
$abtest_experiment_id | Experiment ID | String | Experiment ID | |||
$abtest_experiment_group_id | Experiment Group ID | String | Experiment Group ID |
7. Predefined events and properties for pop-up
Event name | Event display name | Property name | Property display name | Property value type | Description | Trigger time |
---|---|---|---|---|---|---|
$PlanPopupDisplay | Pop-up display | Predefined attribute | Popup display, will collect this event and event attributes | |||
$sf_plan_id | Operational plan name | String | The actual reported value is the ID, which will be mapped to the plan name with a dimension dictionary | |||
$sf_plan_type | Plan type | String | Operational plan, flow canvas, WeChat operation | |||
$sf_channel_service_name | Message send service provider | String | SENSORS_FOCUS | |||
$sf_channel_category | Message channel type | String | POPUP | |||
$sf_audience_id | User ID | String | User ID, only exists when there are audience rules | |||
$sf_plan_strategy_id | Experimental Group ID | String | Property value 0 or -1, 0 represents strategy group, -1 represents control group | |||
$sf_succeed | Message sent successfully | String | Attribute value true or false, true represents success, false represents failure | |||
$sf_fail_reason | Failure reason for message sending | String | Unknown if the pop-up window is successful | |||
$sf_msg_title | Push title | String | ||||
$sf_msg_content | Push Content | String | ||||
$sf_platform_tag | Platform Type Tag | String | ANDRIOD, IOS, H5, WEB | |||
$sf_msg_id | Push Message ID | String | ||||
$sf_lib_version | Popup SDK Version | String | Version number of the Popup SDK | |||
$sf_msg_image_url | Image URL | String | Image URL (image CDN storage address) | |||
$PlanPopupClick | Click behavior | $Predefined Property | Popup click, collect this event and event attributes | |||
$sf_plan_id | Plan Name | String | Actually reported is the ID, and there will be a dimension dictionary that maps to the plan name | |||
$sf_plan_type | Plan Type | String | Operating plan, process canvas, WeChat operation | |||
$sf_channel_service_name | Messaging Service Provider | String | SENSORS_FOCUS | |||
$sf_channel_category | Message Channel Type | String | POPUP | |||
$sf_audience_id | Operational Audience ID | String | Audience ID, only exists when there are audience rules | |||
$sf_plan_strategy_id | Experimental Group ID | String | 0 or -1, 0 represents the experimental group, -1 represents the control group | |||
$sf_msg_title | Push Title | String | ||||
$sf_msg_content | Push Content | String | ||||
$sf_msg_element_type | Popup Button Type | String | Popup element type: normal button, text link, image link, close icon, overlay | |||
$sf_msg_element_content | Popup button text | String | Popup button text, exclusive to the button | |||
$sf_msg_element_action | Popup button behavior | String | Popup click behavior: URL link, custom link, close popup | |||
$sf_msg_image_url | Image URL | String | Image URL (image CDN storage address) | |||
$sf_msg_action_id | Click Behavior ID | String | ||||
$sf_platform_tag | Platform Type Tag | String | ANDROID, IOS, H5, WEB | |||
$sf_msg_id | Push Message ID | String | ||||
$sf_close_type | Close Button Type | String | Closing button type, only closing actions available: close overlay, close icon at the top right of the pop-up, close icon at the bottom of the pop-up, bottom button (set as the button to close the pop-up) | |||
$sf_lib_version | SDK version of the popup | 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.