Skip to content

vuestorefront-community/nuxt-gtag

Repository files navigation


Nuxt GTag

nuxt-gtag

Welcome to the nuxt-gtag Nuxt 3 module.

GitHub Repository Stars Count Follow Us on Twitter Subscribe on our Youtube Channel Chat with us on Discord

Commitizen friendly License PRs Welcome

#TechForUkraine

Russia’s military aggression against Ukraine.

How can you support Ukrainian civil society?

All help is needed. If you are not able to help locally, by sheltering a fellow Ukrainian, you can also:

Setup

  1. Add @vue-storefront/nuxt-gtag dependency to your project
yarn add @vue-storefront/nuxt-gtag # or npm install @vue-storefront/nuxt-gtag
  1. Add @vue-storefront/nuxt-gtag to the modules section of nuxt.config.js
export default {
  modules: [
    // Simple usage
    '@vue-storefront/nuxt-gtag',

    // With options
    ['@vue-storefront/nuxt-gtag', { /* module options */ }]
  ]
}

Using top level options

export default {
  modules: [
    '@vue-storefront/nuxt-gtag'
  ],
  gTag: {
    /* module options */
  }
}

Module Options

export type Options = Partial<{
  bootstrap: boolean;
  config: Partial<{
    id: string;
    params:
      | {
        eventCallback: () => void;
        eventTimeout: number;
        groups: string | string[];
        sendTo: string | string[];
      }
      | Record<string, unknown>;
  }>;
  customPreConnectOrigin: string;
  customResourceURL: string;
  debug: boolean;
  defaultGroupName: string;
  deferScriptLoad: boolean;
  disableScriptLoad: boolean;
  enabled: boolean;
  dataLayerName: string;
  includes: Partial<{
    id: string;
    params:
      | {
        eventCallback: () => void;
        eventTimeout: number;
        groups: string | string[];
        sendTo: string | string[];
      }
      | Record<string, unknown>;
  }>[];
  onAfterTrack: (
    to: VueRouter.RouteLocationNormalized,
    from: VueRouter.RouteLocationNormalized,
  ) => undefined;
  onBeforeTrack: (
    to: VueRouter.RouteLocationNormalized,
    from: VueRouter.RouteLocationNormalized,
  ) => undefined;
  pageViewExcludedRoutes: Array<
    | Record<string, unknown>
    | string
    | Partial<{
        path: string;
        name: string;
        [key: string]: unknown;
      }>
    | VueRouter.RouteLocationNormalized>;
  pageViewPrependBase: boolean;
  pageViewScreenViewEnabled: boolean;
  pageViewSkipSamePath: boolean;
  pageViewTemplate: (
    to: VueRouter.RouteLocationNormalized,
    from?: VueRouter.RouteLocationNormalized,
  ) => VueRouter.RouteLocationNormalized;
  pageViewTracker: boolean;
  pageViewUseFullPath: boolean;
}>;

Contributing

If you like the ideas behind Vue Storefront and want to become a contributor - join our Discord server, check the list of the active issues or contact us directly via contributors(at)vuestorefront(dot)io.

If you have discovered a 🐜 or have feature suggestion, feel free to create an issue on GitHub.

Support us

Vue Storefront is and always will be Open Source, released under MIT Licence.

You can support us in various ways:

  • Contribute - this is how the Core Team is supporting the project!
  • Evangelize - tweet about us, take some speaking slot at a tech conference, etc.

Partners

Vue Storefront is a Community effort brought to You by our great Core Team and supported by the following companies.

See Vue Storefront partners directory

Vue Storefront source code is completely free and released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published