pageview

send pageviews using the official object structure, just a string or even the router object

export default {
  name: 'MyComponent',

  methods: {
    track () {
      this.$gtag.pageview({ page_path: '/about' })
      
      this.$gtag.pageview('/about')
      
      this.$gtag.pageview(this.$route)
    }
  }
}

Remember, this is just an example. check the all API parameters in the official gtag documentation here

Last updated