The original

Recently, it has been found that most of the front end, for burying points and monitoring, is in a relatively primary state, and related articles, but also relatively few.

Recently in the community, I found some articles about the burial point, but I always felt that we took the feeling of partial.

What is a buried point system

Embedded system = embedded SDK + embedded visual platform + embedded access mode

Buried point SDK, to solve the problem, is buried point some general functions of the realization, such as statistics user UV, PV and so on. Internally, it sends relevant data to the buried service background. It exposes a unified SET of apis for easy access.

The buried point visualization platform solves the problem that when my buried point data is reported, I can see the relevant data. For example, today’s UV, PV is how much, compared with yesterday’s sequential growth is how much and so on.

Buried point access is the ability of the buried point system to open to the outside world. Generally, it needs to apply for an APPID, and the APPID is unique. Then, every time the buried point is reported, the data of the project will be known.

A little more detailed:

In essence, it is a JS file. This JS file is provided by the developer. Of course, we can also make our own embedded SDK.

Another reason to call it an SDK is that the SDK is basically the same, just like we did with the Vue project, we need to introduce the vue.js file. We don’t need to know how vue.js is implemented, we just need to know what API it provides.

What the SDK does internally, is it reports data, and by reporting data, it sends an HTTP request interface to the backend server. And then it’s stored in a database.

Buried point visualization platform, is from the database, these data read out, display. At a deeper level, you do data analysis, conversion rate analysis and so on.

2. Burying points and monitoring are two different things

Many students confuse burying points with monitoring. In fact, they are completely different in Dachang.

In terms of functions, monitoring mainly includes JS error monitoring, interface exception monitoring, page performance monitoring, resource loading exception, and some custom exceptions.

The main thing that buried point does is data report, data statistics, data analysis.

From the perspective of usage, monitoring can accurately locate errors. We do not need to add additional things in the code, just need to introduce monitoring SDK, can realize the monitoring of errors.

Burying point is more of a business behavior. At the business level, we have to decide by ourselves what data we want to know, how we want to bury point, and what kind of analysis we want to make. Therefore, after we access the BURYING point SDK, we also need to call the BURYING point API to report data.

So make it clear that burying sites and surveillance are two different things.

3. The implementation of buried points and monitoring is different

By implementation, I mean the implementation principle of the related SDK.

What is the realization principle of buried point?

The nature of buried sites is data reporting, which must be dependent on such latitude data: geographic location, page path, browser information, userId, timestamp, and so on. Information like this should be carried automatically when the user reports it.

Some reported data may be related to services. An ID similar to a service IDENTIFIER is added to the embedded API to associate related data.

What is the implementation principle of monitoring?

There are several types of exception monitoring that are implemented within the SDK.

JS errors can be monitored using window.onerror.

Nowadays, the request is usually fetch or Ajax request. We just need to wrap them up and get our information in the corresponding response event. If the request returned is not 200, we will directly report the error.

Page Performance is implemented through an object provided by the browser, a performance-related API, which records the time taken by the browser to load and parse resources.

The simplest way to handle a resource load error is through the onError event. Script can be used, img tag can be used.

These statements are relatively general, such as js errors, errors about promise and VUE, which need to be supplemented in error capture.

4. Solution — Alibaba Eagle

Of course, the most realistic thing is to let everyone try to monitor and bury points, and recommend everyone to use Ali open source product – Yue Ying

It’s super simple to use.

Address: yueying-docs.effirst.com/yueying-int…