vue单页面之友盟代码统计

vue单页面之友盟代码统计


export default {
  name: 'app',
  mounted () {
    const script = document.createElement('script')
    script.src = 'https://s95.cnzz.com/z_stat.php?id=1111111111&web_id=1111111111'
    script.language = 'JavaScript'
    document.body.appendChild(script)
  },
  watch: {
    '$route' () {
      if (window._czc) {
        let location = window.location
        let contentUrl = location.pathname + location.hash
        let refererUrl = '/'
        window._czc.push(['_trackPageview', contentUrl, refererUrl])
      }
    }
  }
}

你可能感兴趣的:(vue单页面之友盟代码统计)