burying points for analytics

This commit is contained in:
Marvin Zhang
2019-05-30 21:14:30 +08:00
parent 6cd8d0585b
commit a27cef6868
20 changed files with 161 additions and 20 deletions

View File

@@ -1,8 +1,12 @@
export default {
sendPv (page) {
window._hmt.push(['_trackPageview', page])
if (localStorage.getItem('useStats') !== '0') {
window._hmt.push(['_trackPageview', page])
}
},
sendEv (ev) {
window._hmt.push(['_trackCustomEvent', ev])
sendEv (category, eventName, optLabel, optValue) {
if (localStorage.getItem('useStats') !== '0') {
window._hmt.push(['_trackEvent', category, eventName, optLabel, optValue])
}
}
}