Skip to content

Instantly share code, notes, and snippets.

View phillduffy's full-sized avatar

Phill Duffy phillduffy

View GitHub Profile
@matt-e-king
matt-e-king / gtmPlugin.js
Last active November 12, 2022 19:47
Vuex plugin for VueGtm (Google Tag Manager) (https://github.com/mib200/vue-gtm)
/**
Using the Vuex plugin pattern: https://vuex.vuejs.org/en/plugins.html,
this plugin will fire off a gtm.trackEvent for each mutation that occurs within your app.
It will also do a lookup on a literal object methods named after your mutation types. From those methods,
return a object with looks up on the store.
*/
import Vue from 'vue'
// import mutation-types, see example:
/**