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

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