feat(analytics): 添加阿里云日志服务埋点上报功能
在多个页面添加aplus埋点上报逻辑,包括PV和自定义事件上报 在index.html中添加阿里云日志服务SDK初始化配置
This commit is contained in:
parent
654b908f16
commit
f4ceec3c7a
37
index.html
37
index.html
|
|
@ -32,6 +32,43 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="app"><!--app-html--></div>
|
<div id="app"><!--app-html--></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
<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/' + i + '.js';
|
||||||
|
f.parentNode.insertBefore(j, f);
|
||||||
|
})(window, document, 'script', 'aplus_queue', '203467608');
|
||||||
|
|
||||||
|
//集成应用的appKey
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.setMetaInfo',
|
||||||
|
arguments: ['appKey', '68d7b06e8560e34872b9f3a7']
|
||||||
|
});
|
||||||
|
/************************以下内容为可选配置内容****************************/
|
||||||
|
//sdk提供手动pv发送机制,启用手动pv(即关闭自动pv),需设置aplus-waiting=MAN;
|
||||||
|
//注意:由于单页面路由改变时不会刷新页面,无法自动发送pv,所以对于单页应用,强烈建议您关闭自动PV, 手动控制PV事件
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.setMetaInfo',
|
||||||
|
arguments: ['aplus-waiting', 'MAN']
|
||||||
|
});
|
||||||
|
//是否开启调试模式
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.setMetaInfo',
|
||||||
|
arguments: ['DEBUG', true]
|
||||||
|
});
|
||||||
|
//是否指定用作计算umid的id类型,默认为cnaid,目前支持:
|
||||||
|
//1. 微信和QQ: openid; 字节和百度 anonymousid; 支付宝 alipay_id
|
||||||
|
//2. 微信、QQ、字节、百度平台的 unionid
|
||||||
|
//3. 业务方自己生成的随机id uuid
|
||||||
|
// aplus_queue.push({
|
||||||
|
// action: 'aplus.setMetaInfo',
|
||||||
|
// arguments: ['aplus-idtype', 'xxxx'] //取值参考见附表1
|
||||||
|
// });
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- <script type="text/javascript">
|
<!-- <script type="text/javascript">
|
||||||
var link = location.href.split("#")[0];
|
var link = location.href.split("#")[0];
|
||||||
console.log("🚀 ~ link:", link);
|
console.log("🚀 ~ link:", link);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
import { onReachBottom } from "@dcloudio/uni-app";
|
import { onReachBottom } from "@dcloudio/uni-app";
|
||||||
import {
|
import {
|
||||||
|
|
@ -175,6 +175,24 @@ const jumpAll = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const { aplus_queue } = window;
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.sendPV',
|
||||||
|
arguments: [{ is_auto: false }] // 此处上报的数据暂时在后台没有展示
|
||||||
|
});
|
||||||
|
//一个简单的demo
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.record',
|
||||||
|
arguments: ['goDetail', 'CLK', {
|
||||||
|
param1: data.value.id,
|
||||||
|
param2: data.value.title,
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
// 跳转详情
|
// 跳转详情
|
||||||
const jumpDetail = (item: any) => {
|
const jumpDetail = (item: any) => {
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,12 @@ onMounted(async () => {
|
||||||
|
|
||||||
// 概念标签贴标
|
// 概念标签贴标
|
||||||
getNewsList();
|
getNewsList();
|
||||||
|
|
||||||
|
const { aplus_queue } = window;
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.sendPV',
|
||||||
|
arguments: [{ is_auto: false }] // 此处上报的数据暂时在后台没有展示
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -98,11 +98,8 @@
|
||||||
|
|
||||||
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
<view class="logout" @click="loginOut" v-if="Session.get('token')">退出登录</view>
|
||||||
|
|
||||||
<LoginPopup
|
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||||
:show="LoginShow"
|
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" />
|
||||||
@handlePopupClose="handlePopupClose"
|
|
||||||
@handlePopupSuccessCallback="handlePopupSuccessCallback"
|
|
||||||
@handlePopupErrorCallback="handlePopupErrorCallback" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -303,13 +300,19 @@ function goSreach() {
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
});
|
});
|
||||||
|
const { aplus_queue } = window;
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
initData();
|
initData();
|
||||||
if (!Session.get("token")) {
|
if (!Session.get("token")) {
|
||||||
LoginShow.value = true;
|
LoginShow.value = true;
|
||||||
}
|
}
|
||||||
getLineDataFn();
|
getLineDataFn();
|
||||||
|
|
||||||
|
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.sendPV',
|
||||||
|
arguments: [{ is_auto: false }] // 此处上报的数据暂时在后台没有展示
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="all">
|
<view class="all">
|
||||||
<PageHeaderView
|
<PageHeaderView :title="type == 0 ? '热门行业池Top10' : '风口概念池Top10'"></PageHeaderView>
|
||||||
:title="type == 0 ? '热门行业池Top10' : '风口概念池Top10'"
|
|
||||||
></PageHeaderView>
|
|
||||||
|
|
||||||
<!-- 类目标签 start -->
|
<!-- 类目标签 start -->
|
||||||
<view class="page_content">
|
<view class="page_content">
|
||||||
<view class="tag_list">
|
<view class="tag_list">
|
||||||
<view
|
<view :class="['tag_item', clickTagIndex == index ? tagClickedClass : '']" class="tag_item"
|
||||||
:class="['tag_item', clickTagIndex == index ? tagClickedClass : '']"
|
v-for="(item, index) in tagList" :key="index" @click="clickTag(index)">
|
||||||
class="tag_item"
|
|
||||||
v-for="(item, index) in tagList"
|
|
||||||
:key="index"
|
|
||||||
@click="clickTag(index)"
|
|
||||||
>
|
|
||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -22,12 +15,7 @@
|
||||||
|
|
||||||
<!-- 列表 start -->
|
<!-- 列表 start -->
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view
|
<view v-for="(item, index) in list" :key="index" class="news-item" @click="goDetail(item)">
|
||||||
v-for="(item, index) in list"
|
|
||||||
:key="index"
|
|
||||||
class="news-item"
|
|
||||||
@click="goDetail(item)"
|
|
||||||
>
|
|
||||||
<view class="news-content">
|
<view class="news-content">
|
||||||
<text class="news-title">{{ item.title }}</text>
|
<text class="news-title">{{ item.title }}</text>
|
||||||
<text class="news-desc">{{ item.summary }}</text>
|
<text class="news-desc">{{ item.summary }}</text>
|
||||||
|
|
@ -165,6 +153,12 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
getListByTagFn();
|
getListByTagFn();
|
||||||
|
|
||||||
|
const { aplus_queue } = window;
|
||||||
|
aplus_queue.push({
|
||||||
|
action: 'aplus.sendPV',
|
||||||
|
arguments: [{ is_auto: false }] // 此处上报的数据暂时在后台没有展示
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -254,11 +248,16 @@ onMounted(async () => {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
display: -webkit-box; /* 设置为WebKit内核的弹性盒子模型 */
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical; /* 垂直排列 */
|
/* 设置为WebKit内核的弹性盒子模型 */
|
||||||
-webkit-line-clamp: 2; /* 限制显示三行 */
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden; /* 隐藏超出范围的内容 */
|
/* 垂直排列 */
|
||||||
text-overflow: ellipsis; /* 使用省略号 */
|
-webkit-line-clamp: 2;
|
||||||
|
/* 限制显示三行 */
|
||||||
|
overflow: hidden;
|
||||||
|
/* 隐藏超出范围的内容 */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* 使用省略号 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-meta {
|
.news-meta {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue