Vue directive for Google gtag.js
yarn add vue-gtagjs-directive
First, include gtag.js in you page or use vue-gtagjs
import gtagHelper from 'vue-gtagjs-directive'
gtagHelper.setTrackId('UA-XXXXXXXX-1')
//- if you have setTrackId, track-id attribute can be omitted
button(v-gtag.config="{page_path:'/path'}", trigger-event="mouseup", :before-send="beforeSend", :after-send="afterSend") test
//- otherwise, track-id is mandatory
button(v-gtag:config="{page_path:'/path'}", track-id="UA-XXXXXXXX-1", trigger-event="mouseup") test
button(v-gtag:event="{event_category:'CATA','event_label':'Label'}", event-name="EVENT-NAME") test