Web SDK Integration Guide
Usage Notes
This document is the standard integration guide for JOperate Web SDK.
- If you want to quickly test it, refer to this document to run the demo within a few minutes.
- The Jiguang Push documentation site contains all related guides, APIs, tutorials, and other documentation. Updated versions of this document will also be published on that site in a timely manner.
Product Description
Use event templates to collect app user behavior events and report them to Jiguang servers. Jiguang displays processed data to developers through WebPortal, helping developers better understand how users use their applications.
Main Scenario
Custom event statistics.
Integration Package Contents
- example
- A web page that demonstrates the basic usage of JOperate SDK and can be used as a reference.
Obtain App Information
After completing data source integration, go to "Data Source List - Details" to view the AppKey and scheme. For details, see WebJS Platform Integration.
Web SDK Integration Guide
Add the following JS to each page:
<script type="text/javascript" src="https://web-stat.jpush.cn/web/report/html/joperate-web.min.js"></script>
After importing this JS, you can use the global object JOperateInterface on Window.
Note: Use this link directly. Do not download this file into your project. Otherwise, statistics may become invalid after we update the data structure or API interfaces.
SDK Initialization
- Initialization adds a Jiguang iframe to the page, so initialization must be called after the DOM of each page has loaded, or after the page onload event is received:
window.JOperateInterface.init({
appKey: "9f7248bf870ddec7048e6c0b", // Required. This appkey must be bound to a data source. See "Obtain App Information" above for details.
debugMode: true,// Whether to enable debug mode. true prints more log information. false outputs only w and e level logs.
channel: "default-channel",// Channel name. Default value: default-channel.
})
Data Verification Mode
If you need to view real-time reporting, scan the code to enter data verification mode. For details, see Data Verification Documentation.
More APIs
For usage of other APIs, see the API documentation: Web SDK API
Technical Support
Email: support@jiguang.cn