Vue H5 volcano engine buried point

Corresponding article: Volcano Engine

The initialization is placed under the public index.html:

引用sdk:
<script async src="https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/collect-rangers-v5.1.3.js"></script>
(function(win, export_obj) {
     win['LogAnalyticsObject'] = export_obj;
     if (!win[export_obj]) {
         function _collect() {
             _collect.q.push(arguments);
         }
         _collect.q = _collect.q || [];
         win[export_obj] = _collect;                
     }
    win[export_obj].l = +new Date();
})(window, 'collectEvent');

window.collectEvent('init', {
   app_id: app_id, // 参考2.1节获取,注意类型是number而非字符串
   channel: 'cn', // 设置数据上送地址
   log: true, // true:开启日志,false:关闭日志
   autotrack: false // 全埋点开关,true开启,false关闭
});
// 此处可添加设置uuid、设置公共属性等代码
window.collectEvent('start'); // 通知SDK设置完毕,可以真正开始发送事件了

insert image description here
This means that the initialization is successful and
you can just bury it on the required page

示例:
window.collectEvent('event', {
   key_string: 'value_string',
   key_int: 10
});

Supongo que te gusta

Origin blog.csdn.net/qq_43384836/article/details/127668774
Recomendado
Clasificación