使用uniapp打包的H5页面做埋点(使用第三方平台 友盟+) link:https://mp.umeng.com/analysis/62b9873d88ccdf4b7eaee1b1/conversion/custom-event

1.H5接入SDK文档,Link: https://developer.umeng.com/docs/147615/detail/290919
1.1 在当前的vue页面加入代码 image.png

  1. (function(w, d, s, q, i) {
  2. w[q] = w[q] || [];
  3. var f = d.getElementsByTagName(s)[0],
  4. j = d.createElement(s);
  5. j.async = true;
  6. j.id = 'beacon-aplus';
  7. j.src = 'https://d.alicdn.com/alilog/mlog/aplus/' + i + '.js';
  8. f.parentNode.insertBefore(j, f);
  9. })(window, document, 'script', 'aplus_queue', '203467608');
  10. //集成应用的appKey
  11. aplus_queue.push({
  12. action: 'aplus.setMetaInfo',
  13. arguments: ['appKey', '62b9873d88ccdf4b7eaee1b1']
  14. });
  15. aplus_queue.push({
  16. action: 'aplus.sendPV',
  17. arguments: [{is_auto: false}]
  18. });
  19. var pageEventConfig = {
  20. is_auto: true
  21. };
  22. //是否开启调试模式
  23. aplus_queue.push({
  24. action: 'aplus.setMetaInfo',
  25. arguments: ['DEBUG', true]
  26. });
  27. /******************************************************************/

1.2 .使用自定义事件 image.png

  1. onHide() {
  2. let that=this;
  3. // <--------友盟+ 用户关闭退出页面 自定义事件---------->
  4. const {aplus_queue} = window;
  5. aplus_queue.push({
  6. action: 'aplus.record',
  7. arguments: ['schaoka_event_endPage']
  8. });
  9. },