建设企业网站需要什么,招聘网页怎么制作,网站建设项目中标通知,杭州seo价格最近在对接浙政钉#xff0c;稳定性监控、通用采集 SDK、基础埋点、基础埋点#xff0c;每次发布上去#xff0c;工作人员那边反馈抓取不到信息
稳定性监控代码、通用采集 SDK
index.html !-- 流量稳定监控 S 关于埋点上线打开--script srchttps://wpk-…最近在对接浙政钉稳定性监控、通用采集 SDK、基础埋点、基础埋点每次发布上去工作人员那边反馈抓取不到信息
稳定性监控代码、通用采集 SDK
index.html !-- 流量稳定监控 S 关于埋点上线打开--script srchttps://wpk-gate.zjzwfw.gov.cn/static/wpk-jssdk.1.0.2/wpkReporter.js crossorigintrue/scriptscript// 稳定性监控try {const config {bid: , //项目提交上线之后 由业主提供给你signkey: 1234567890abcdef, gateway: https://wpkgate-emas.ding.zj.gov.cn};const wpk new wpkReporter(config);wpk.installAll();window._wpk wpk;} catch (err) {console.error(WpkReporter init fail, err);}// 通用采集 SDK(function (w, d, s, q, i) {w[q] w[q] || [];var f d.getElementsByTagName(s)[0], j d.createElement(s);j.async true;j.id beacon-aplus;j.src https://alidt.alicdn.com/alilog/mlog/aplus_cloud.js;f.parentNode.insertBefore(j, f);})(window, document, script, aplus_queue);aplus_queue.push({action: aplus.setMetaInfo,arguments: [aplus-rhost-v, alog-api.ding.zj.gov.cn]});aplus_queue.push({action: aplus.setMetaInfo,arguments: [aplus-rhost-g, alog-api.ding.zj.gov.cn]});var u navigator.userAgentvar isAndroid u.indexOf(Android) -1var isIOS !!u.match(/\(i[^;];( U;)? CPU.Mac OS X/)aplus_queue.push({action: aplus.setMetaInfo,arguments: [appId, isAndroid ? 28302650 : isIOS ? 28328447 : 47130293]});/script基础埋点 具体到某个页面或者封装一个方法挂在到全局 注意我们用的是taro-vue框架 utils/pointSDK export async function addBuryPoint(account, accountId, openid, page_id, page_name, page_url) {// 3用户信息埋点// 如采集用户信息是异步行为需要先执行这个BLOCK埋点aplus_queue.push({action: aplus.setMetaInfo,arguments: [_hold, BLOCK]});// 2基础埋点// 单页应用 或 “单个页面”需异步补充PV日志参数还需进行如下埋点aplus_queue.push({action: aplus.setMetaInfo,arguments: [aplus-waiting, MAN]});//// 单页应用路由切换后 或 在异步获取到pv日志所需的参数后再执行sendPVaplus_queue.push({action: aplus.sendPV,arguments: [{is_auto: false}, {// 当前你的应用信息此两行按应用实际参数修改不可自定义。sapp_id: 34927,sapp_name: szwugen,page_id: page_id, // 可以用this.$route.meta.pagePath代替page_name: page_name, // 可以用this.$route.meta.name代替page_url: page_url // 可以用this.$route.meta.pagePath代替}]})// 设置用户ID用户设备ID可不做上报若上报可使用开放平台JSAPI获取UUID//用户id需要埋政钉用户真实信息用户ID必须用accountId可通过开放平台“获取用户详情”接口获取。aplus_queue.push({action: aplus.setMetaInfo,arguments: [_user_nick, account],});//用户id需要埋政钉用户真实信息用户ID必须用accountId可通过开放平台“获取用户详情”接口获取。aplus_queue.push({action: aplus.setMetaInfo,arguments: [_user_id, accountId],});aplus_queue.push({action: aplus.setMetaInfo,arguments: [_dev_id, openid],});// 如采集用户信息是异步行为需要先设置完用户信息后再执行这个START埋点// 此时被block住的日志会携带上用户信息逐条发出aplus_queue.push({action: aplus.setMetaInfo,arguments: [_hold, START],});
}app.ts
import { createApp } from vue
import ./app.scss
import { addBuryPoint } from ./utils/pointSDK
const App createApp({onShow(options) { },// 入口组件不需要实现 render 方法即使实现了也会被 taro 所覆盖
})
App.provide(addBuryPoint, addBuryPoint)
export default Appindex.vue引入方式 const $addBuryPoint: any inject(addBuryPoint);$addBuryPoint(zzd_UserInfo.account, zzd_UserInfo.accountId, zzd_UserInfo.openid,id,name,path);本地调试 index.html !-- 本地调试 引入的文件--script srchttps://g.alicdn.com/code/npm/ali/dingtalk-h5-remote-debug-sdk/0.1.3/app.bundle.js/scriptscript//真机调试--有效期很短h5RemoteDebugSdk.init({uuid: e3340b3f-bc34-4ea9-b06d-88904cc3a23b,observerElement: document.documentElement,});/script每次调试关闭都需要再后台重新生成一个uuid 注意调试时一定要保证在同一网域直接在专有钉钉通过h5地址访问就可以看到日志了 注意本地调试也不是完全好使我在本地调试时一直抓取不到用户信息用了两天的时间也没找到原因就抱着试试的态度审核了一版没想到竟然能正常抓取用户埋点了这个过程真的太煎熬了不过结果至少是好的顺利解决这个麻烦