修改统计代码
This commit is contained in:
255
src/App.vue
255
src/App.vue
File diff suppressed because one or more lines are too long
@@ -131,6 +131,8 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
|
||||
let isInitialNavigation = false
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
//进度条开始
|
||||
NProgress.start();
|
||||
@@ -142,20 +144,25 @@ router.beforeEach((to, from, next) => {
|
||||
let title = meta['title']
|
||||
if (title) setSeoTitle(title)
|
||||
|
||||
|
||||
if (window._hmt) {
|
||||
if (to.path) {
|
||||
// window._hmt.push(['_trackPageview', '/#' + to.fullPath])
|
||||
window._hmt.push(['_trackPageview', to.fullPath])
|
||||
if (isInitialNavigation) {
|
||||
isInitialNavigation = false
|
||||
} else {
|
||||
return
|
||||
console.log("1111111,", to.path, to.fullPath);
|
||||
if (window._hmt) {
|
||||
if (to.path) {
|
||||
// window._hmt.push(['_trackPageview', '/#' + to.fullPath])
|
||||
window._hmt.push(['_trackPageview', to.fullPath])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (window._czc) {
|
||||
let location = window.location
|
||||
let contentUrl = location.pathname + location.hash
|
||||
let refererUrl = "/"
|
||||
// 用于发送某个URL的PV统计请求
|
||||
window._czc.push(["_trackPageview", contentUrl, refererUrl])
|
||||
if (window._czc) {
|
||||
let location = window.location
|
||||
let contentUrl = location.pathname + location.hash
|
||||
let refererUrl = "/"
|
||||
// 用于发送某个URL的PV统计请求
|
||||
window._czc.push(["_trackPageview", contentUrl, refererUrl])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user