Last updated 4 years ago
Remember, this is just an example. check the all API parameters in the official gtag documentation
export default { name: 'MyComponent', methods: { track () { this.$gtag.pageview({ page_path: '/about', }) } } }
import { useGtag } from "vue-gtag-next"; export default { name: "MyComponent", setup() { const { pageview } = useGtag() const track = () => { pageview({ page_path: "/about" }); }; return { track, }; }, };