Buried point system:
Composition: application, data analysis platform, data platform SDK
Buried point reporting is the process of uploading application layer events to upper-layer platforms.
Application layer events:
- Page events: For example, the number of times a user stays and is active on an application page, which is injected once during project initialization and does not need to be maintained in the code.
- Trigger events: Custom trigger events, such as clicking a specific button
Sdk-monitor-tracer for handling page events
Monitor-tracer is a front-end SDK for monitoring the visible and active duration of pages and components. It is also a core component of monitor’s front-end buried point system.
Example:
- Tag the element you want to listen on (a single DOM element)
Finding the element to listen on in the DOM element, the Monitor-Tracer SDK specifies that if a component needs to count the active time, it needs to add a Monitor-PV or data-monitor-PV attribute to it.
<div monitor-pv='{"event":"one_pv","params":{... }}' One </div> <div>Two</div>Copy the code
Conclusion: One adds the monitor-PV attribute, and the visible duration is recorded and counted, while Two does not.
- Plug-in listening element
You need to install the @byted-cg/babel-plugin-tracer Babel plug-in, which looks for components with monitor-PV attributes during compilation and wraps a custom tag around them.
Sdk-monitor handles trigger events
Buried point reporting process: After a buried point is sent to monitor by the application layer, the Monitor first processes the data and then invokes the SDK of the data platform to report the buried point event to the data platform.
Buried injection mode
Class instruction:
<Button monitor-click={json.stringify ({type:"func_operation",params:{value:3}})}></Button>Copy the code