Mini program monitoring
#
1.OverviewAll the behavior data of the Mini Program can be accessed to the DM Hub through the event tracking implementation. it is impossible to obtain any behavior data by only authorizing the DM Hub. After data is accessed, you can view the PV, UV, the number of openings, and the number of new users in the applet monitoring function. At the same time, The traffic source of the applet within a specified time period and traffic trends can be observed as well.
#
2.Event based tracking implementation on mini program#
2.1Download SDKDownload the SDK from the setting center of DM Hub, the path is: [Setting Center] - [Touch point]-[WeChat Mini Program]
Note: Different clouds and tenants have different SDK configuration information.
Copy the file to the utils folder of the applet project, and add it in the first line of app.js:
#
2.2Add WeChat request legal domain nameIn the WeChat development settings, add the server address to the request legal domain name of the server domain name. For details, please refer to WeChat server domain name settings
The administrators or developers are able to add a domain name in the WeChat applet platform,development-developer settings, the domain name is cbe.convertlab.com. if it is a private deployment, please contact the online assistant to confirm the domain name.
#
2.3Check whether the SDK access is successfulkey in by the means of onLaunch in app.js
Is there a message in the Network of the console ( https://cdn.convertlab.com/__utm ),and the status is 200
#
2.4Identity settings#
2.4.1Common Identity Types for Mini ProgramsNo. | Identities | Identity types | notes |
---|---|---|---|
1 | WeChat unionid | wechat-unionid | |
2 | WeChat mini program openid | applet-wechat | |
3 | Mobile phone | mobile | |
4 | Member ID | c_memberid | Custom identity |
It is recommended to set the customer's mobile phone number, WeChat unionid, and WeChat applet openid as the customer identity. The priority of the three identities is: mobile phone number> WeChat unionid> applet openId.
In addition to the system default identity, you can create a custom identity according to your needs in [Settings]-[Identity]. Refer to theidentity introduction document for operation introduction
#
2.4.2Identity SettingAfter getting the corresponding identity, you should immediately set the customer identity and set the corresponding identity type (type) and value as well. For example:
Please refer to the identity model:DM Hub user identity model
If there are multiple identities: (support up to 3 identities at the same time), please put them in identityType/identityType2/identityType3 respectively
If you don’t get all the identities at the same time, you can push identityType/identityType2/identityType3 separately
Note: The same identityType should always correspond to one identity type.
If using
and using at the same time
The result is that the first identityType:'applet-wechat' is invalid.
#
2.4.3Identify usersThe event will remain anonymous if there is no identity value. After obtaining the user's openId, please set it in the global parameters
#
3.Examples of recording eventsIf you need to record custom events, please add them in the system first.
The interface and identity model of the applet SDK should be consistent with the JS SDK. For the detailed introduction of the interface and the format of URL parameters, please refer to chapters 2, 3, and 4 in the JS SDK of [the webpage].(http://apidocsv2.dmhub.cn/trackevent/track_sdk_js)
Note: only javascript can be used to submit events for Mini Programs
##Error situation (supported since Ver.1.67):
If app.cl_tracker is null, please use the following method to initialize the SDK:
Add var cl_tracker = require('./utils/cl_tracker.js'); to the first line of app.js;
Actively call cl_tracker.onAppLaunch and cl_tracker.onAppShow in App's onLaunch and onShow events
Note:that the onAppShow method needs to take parameters.
The app.js sample code is as follows:
#
4.Data monitor#
4.1Data overviewPV:The total number of visits to all pages of the Mini Program within a specified time period.
UV:The number of users accessing the Mini Program during the specified time period.
Open Number of new users:The total number of times the user has opened the applet within the specified time period, from opening the applet to closing the applet or exiting after timeout.
新用户数:The number of users who visited for the first time in a specified time period.
#
4.2Ad monitorAdvertising monitoring can add parameters to the applet path. When the applet is launched, the path with parameters can be used to track data from different sources or marketing campaign in the system to measure the flow of different sources.
For the specific use and configuration instructions of the source, refer to the introduction of Source
Method 1:The application scenario is when there are fewer parameters and no more than 128 bits. This method can directly analyze the parameters, which is convenient and fast
Method 2:The application scenario is that there are many parameters that need to be added, and if it exceeds 128 bits, this method needs to call OpenAPI to obtain the complete URL for parameter analysis. Refer to the API documentation