Plugin Integration (Web)
|
Collect
1. Plugin Usage
Currently, Web/Mini Program is gradually evolving into a plugin-based architecture. The concept of "everything is a plugin" will become more apparent.
Before using the plugin, please refer to the Plugin Usage.
2. Existing Plugin List and Usage
The root directory of the plugins is /dist/web/plugin/, and the directory of the plugins is the address relative to the plugin root directory.
2.1. Built-in unused plugins
Built-in unused plugins that need to be manually called with the use method and the plugin name passed in. For example, use the built-in unused PageLeave plugin.
import sensors from '/dist/web/sensorsdata.es6.js'; sensors.use('PageLeave', option); sensors.init({ ...初始化参数 })
Plugin Name (Plugin variable name in the SDK) | Directory where the plugin is located (/dist/web/plugin/) | Plugin Description | Instructions for Use | Minimum required version for using the latest version of the plugin | Whether it is built-in in the SDK under /dist/web/ | |
---|---|---|---|---|---|---|
1 | Amp | amp | Google AMP | Documentation | v1.24.1 | Built-in |
2 | SensorsChannel | channel | Channel Link Tracking and Feedback | Documentation | v1.24.1 | Built-in |
4 | Deeplink | deeplink | Deep Link | Documentation | v1.24.1 | Built-in |
5 | PageLeave | pageleave | Page Browsing Duration | Documentation | v1.24.1 | Built-in |
6 | PageLoad | pageload | Page Load Duration | Documentation | v1.24.1 | Built-in |
7 | RegisterPropertyPageHeight | register-property-page-height | Collect Page Height Property | Documentation | v1.24.1 | Built-in |
8 | SiteLinker | site-linker | Multi-domain integration | Documentation | v1.24.1 | Built-in |
2.2. External Plugin
The external plugin needs to be integrated and used manually. For example, by using the external session-event plugin.
import sensors from '/dist/web/sensorsdata.es6.js'; import sessionEvent from '/dist/web/plugin/session-event/index.es6.js'; sensors.use(sessionEvent); sensors.init({ ...初始化参数 })
Plugin name (variable name of the plugin in the SDK) | Plugin location (/dist/web/plugin/) | Plugin description | Instructions for use | Minimum version requirement for using the latest version of the plugin | Whether it is built-in in the /dist/web/ directory of the SDK | |
---|---|---|---|---|---|---|
1 | AesEncryption | aes-encryption | AES encryption plugin | Documentation | v1.24.1 | External |
2 | Exposure | exposure | Element Exposure Event Collection | Documentation | v1.24.1 | External |
3 | SessionEvent | session-event | 12h/30min Session Splitting Event Collection Plugin | Documentation | v1.24.1 | External |
4 | SiteLinkerConcatUtm | site-linker-concat-utm | Multi-domain Linkage Plugin (with utm parameters) | Documentation | v1.24.1 | External |
5 | WechatWebViewChannel | wechat-webview-channel | Mini-program webview channel attribution | Documentation | v1.24.1 | External |
6 | SensorsABTest | abtesting-sdk-web | Web A/B Testing - Web A/B Test | Documentation | v1.24.1 | External |
7 | Popup (H5 version) WebPopup (Web version) | sf-sdk-miniprogram | Popup - Pop-up Window (H5 and Web) | Documentation | v1.24.1 | External |
8 | GeneralEncryption | general-encryption | Asymmetric encryption data reporting | Documentation | v1.24.3 | External |
9 | CustomEventsSender | custom-events-sender | Custom data receiving endpoint | Documentation | v1.24.8 | External |
10 | SfInstantEvent | sf-instant-event | SF - Instant event reporting | v1.24.8 | External | |
11 | ChannelUtm | channel-utm | Collect advertising channel utm parameters | Documentation | v1.24.1 | External |
12 | SMEncryption | sm-encryption | SM encryption plugin | Documentation | v1.25.20 | External |
2.3. Built-in Used Plugins
Built-in used plugins are default features of the Web SDK (for reference only). Please do not integrate or use them manually!
Plugin Directory | Plugin Description | Instructions for Use | Minimum Version Required for the Latest Version of the Plugin | Whether the SDK in /dist/web/ is Built-in | |
---|---|---|---|---|---|
1 | android-bridge | Android Platform | Documentation | v1.24.1 | Built-in and Used |
2 | android-obsolete-bridge | Old Version of Android Platform Integration | Documentation | v1.24.1 | Built-in and Used |
3 | ios-bridge | iOS Platform Integration | Documentation | v1.24.1 | Built-in used |
4 | ios-obsolete-bridge | Old version access on iOS platform | Documentation | v1.24.1 | Built-in used |
5 | utm | UTM channel source | Documentation | v1.24.1 | Built-in used |
6 | disable-sdk | Disable/Enable SDK collection | Documentation | v1.24.5 | Built-in Usage |
7 | ajax-sender | Ajax Data Sending | Documentation | v1.24.8 | Built-in Usage |
8 | batch-sender | Batch Data Sending | Documentation | v1.24.8 | Built-in Usage |
9 | beacon-sender | Beacon Data Sending | Documentation | v1.24.8 | Built-in Usage |
10 | debug-sender | Debug Sending Data | Documentation | v1.24.8 | Internal Use |
11 | image-sender | Image Sending Data | Documentation | v1.24.8 | Internal Use |
12 | jsapp-sender | Customize storage to collect data and customize sending timing | Documentation | v1.24.8 | Internal Use |
2.4. Third-party Plugin
The above plugins are maintained by Sensors Analytics and are relatively common. However, due to the increasing demand, some plugins customized by clients cannot be developed by Sensors Analytics. At this time, we highly recommend developing third-party plugins.
In order to provide a platform for sharing third-party plugins, we have established the Plugin Sharing Repository. You can submit your developed code here.
If you have the intention to develop third-party plugins to customize your own needs, you can contact us through the following channels. Currently, third-party plugin development is in its early stages, and our research and development team will provide sufficient support.
- In the GitHub issue discussion
- Contact development email
- Consult technical consultants in the official customer WeChat group
Note: Third-party plugins are also external plugins and are used in the same way.
2.5. Note
- The version of the plugin must be consistent with the SDK. If one side is upgraded, both sides need to be updated at the same time. Remember, do not update only one side.
- Starting from version v1.24.1, use the /dist/web/ directory to achieve simultaneous updates. Because the SDK and the plugin are both in this directory, as long as the references are pointing here, they can be updated simultaneously.
- The SDK version requirement here is the minimum SDK version required when the plugin has the latest features.
- The plugin does not have its own version number. If the plugin is modified, the overall version will increase.
- If GitHub is not accessible, you can also download from npm and check it in the local directory /dist/web/plugin.
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.