import { createGtm } from '@gtm-support/vue-gtm'

export default defineNuxtPlugin((nuxtApp) => {
  // run only on production
  //if (useRuntimeConfig().public.environment == 'prd') return
  nuxtApp.vueApp.use(createGtm({
    id: 'GTM-TF68KP62', // paste your GTM id here
    defer: false,
    compatibility: false,
    enabled: true,
    debug: true,
    loadScript: true,
    vueRouter: useRouter(),
    trackOnNextTick: false,
  }))
})