首页 > 其他分享 >浙里办埋点 老版本

浙里办埋点 老版本

时间:2023-03-06 17:00:24浏览次数:35  
标签:浙里 aplus queue push arguments 版本 action 埋点 infos

<script src="//at.alicdn.com/t/font_2166499_0tup9kbanl3.js"></script>
<script type="text/javascript" src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.0.1/zwjsbridge.js"></script>

index.html:

    <!-- 埋点 -->
    <script> 
      (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://d.alicdn.com/alilog/mlog/aplus.js?id=202951085';
        f.parentNode.insertBefore(j, f);
      })(window, document, 'script', 'aplus_queue');
      
      aplus_queue.push({
        action: 'aplus.setMetaInfo',
        arguments: ['aplus-waiting', 'MAN']
      })
      
      aplus_queue.push({ action: 'aplus.setMetaInfo', arguments: ['aplus-rhost-v', 'alog.zjzwfw.gov.cn'] });
      aplus_queue.push({ action: 'aplus.setMetaInfo', arguments: ['aplus-rhost-g', 'alog.zjzwfw.gov.cn'] });
      
      aplus_queue.push({
        action: 'aplus.setMetaInfo',
        arguments: ['appId', '60506758'] // 此appid固定
      });
    </script>

home.vue:

  // 获取信息 设置埋点
    getData() {
      const that = this
      let infos = {
        userType: '',
        lat: '',
        lon: ''
      }
      ZWJSBridge.onReady(() => {
        // 获取用户类型
        ZWJSBridge.getUserType().then((result) => {
          infos.userType = result.userType
          that.SetZwaplus(infos)
        }).catch((error) => {
          console.log(error);
        });
        // 获取经纬度
        ZWJSBridge.getLocation().then((result) => {
          infos.lat = result.latitude
          infos.lon = result.longitude
          that.SetZwaplus(infos)
        }).catch((error) => {
          console.log(error);
        });
      })
    },
    // 用户信息埋点
    userAplus() {
      console.log('------------进入用户信息埋点---------------');
      aplus_queue.push({
        action: 'aplus.setMetaInfo',
        arguments: ['_user_nick', '放项目获取到的用户名']
      })
      aplus_queue.push({
        action: 'aplus.setMetaInfo',
        arguments: ['_user_id', '放项目获取到的userid']
      })
    },
    // 基础采集
    SetZwaplus(infos) {
      if (infos.userType && infos.lon && infos.lat) {
        console.log(infos, '--------------进入PV日志参数埋点----------------');
        aplus_queue.push({
          action: 'aplus.setMetaInfo',
          arguments: ['_hold', 'BLOCK']
        })
        // 单页应用路由切换后 或 在异步获取到 pv 日志所需的参数后再执行 sendPV:
        aplus_queue.push({
          action: 'aplus.sendPV',
          arguments: [
            {
              is_auto: false
            },
            {
              miniAppId: '放自己项目的AppId',
              miniAppName: '放自己项目的AppName',
              long: infos.lon,
              lati: infos.lat,
              userType: infos.userType,
            }
          ]
        })
        aplus_queue.push({
          action: 'aplus.setMetaInfo',
          arguments: ['_hold', 'START']
        })
      }
    }
mounted() {
  this.userAplus()  
  this.getData()  
}

 

标签:浙里,aplus,queue,push,arguments,版本,action,埋点,infos
From: https://www.cnblogs.com/shiyi-iiii/p/17184495.html

相关文章

  • Typore免费版本
    Typora免费版本0.11.18软件下载mac版(0.11.18)链接:https://pan.baidu.com/s/1Nip--aWrxK_fTJCTnCIkyA?pwd=0510提取码:0510--来自百度网盘超级会员v4的分享windows......
  • CAP 7.1 版本发布通告
    前言今天,我们很高兴宣布CAP发布7.1版本正式版,我们在这个版本中解决了一个长期以来的问题,也添加了几个小特性及修复了几个Bug。从NuGet数据来看,我们于去年底发布的7......
  • Apache Hudi 0.13.0版本重磅发布!
    ApacheHudi0.13.0版本引入了许多新功能,包括Metaserver、变更数据捕获、新的RecordMergeAPI、Deltastreamer支持新数据源等。虽然此版本不需要表版本升级,但希望用户......
  • Linux Kernel 4.9分支的第6个候选版本发布
    上周末和往常一样,LinusTorvalds推出了Linux Kernel4.9的最新候选版本。作为公开测试的第六个LinuxKernel4.9候选版本,主要更新了RMDA和修复GPU等,并改善版本和工具,部......
  • Linux Kernel 4.9分支的第6个候选版本发布
    上周末和往常一样,LinusTorvalds推出了​​Linux​​ Kernel4.9的最新候选版本。作为公开测试的第六个LinuxKernel4.9候选版本,主要更新了RMDA和修复GPU等,并改善版本和工......
  • 浙里办通用请求的封装
    开发浙里办应用都知道,我们发布到线上的接口需要按这样的方式去请求:但是往往本地开发的时候是连得公司测试环境,而且接口调用方式也不长这样。我第一次开发浙里办项目的时......
  • CAD几种插件安装方式,及报错版本问题
    0.双击setup.exe(源泉建议方式)1.直拖入相关如sys/下的,Setup.fas,install.vlx(海龙建议方式)2.路径添加插件:命令:op-->文件-->支持文件搜索路径-->添加插件目录sys/.即......
  • 版本号及面向对象设计原则
    1.版本号软件版本号就是商品的型号。常见的版本号命名规则和几种类型[name].x.y.z-[state]name 为可选段,一般为v,表示Version;x.y.z 为各版本的序号,一般都会遵循语义......
  • Win32 通过manifest切换Comctl32公共控件版本样式
    Comctl32公共控件有两个大版本v5和v6样式有一定区别,可以参考下述链接https://www.cnblogs.com/cyds/p/16251848.htmlvsc++现在默认有一个manifest内嵌在资源文件里,配置......
  • tomcat8之前版本的request乱码解决
    Stringusername=req.getParameter("username");username=newString(username.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8); ......