[Vuejs]-GA event tracking in Buttons in Vue.js

0👍

<button @click="callGa">GA Call</button>

methods: {
   callGa() {
       ga(‘send’, ‘event’, { eventCategory: ‘Recommendations‘, eventAction: ‘View’, eventLabel: ‘Home Page Recommendation’, eventValue: 0});
   }
}

ga should be imported or included to window or somehow else provided inside component

Leave a comment