产品经理的需求是某些路由使用友盟 A账号跟踪, 某些路由使用友盟 B账号跟踪
项目是vue单页应用, 已经关闭自动追踪, 根据路由设置账号手动跟踪
index.html
<script type="text/javascript">
/*统计代码*/var _czc = _czc || [];_czc.push(["_setAutoPageView", false]);
</script>
<body>
App.vue
watch: {
'$route'() {
//判断路由
if(/.../.test(this.$route.path)) {
_czc.push(["_setAccount", siteIdA])
} else {
_czc.push(["_setAccount", siteIdB])
}
let location = window.location
let content_url = location.pathname + location.hash
let referer_url = '/'
_czc.push(['_trackPageview', content_url, referer_url])
}
}
现在看友盟后台数据, AB的账号都有对方的页面路径, 求教2个账号应该怎么写