@vue-storefront/nuxt-gtag
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.733latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.733
1.0.61
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i @vue-storefront/nuxt-gtag

Weekly Downloads

40

Version

1.0.7

License

MIT

Unpacked Size

53 kB

Total Files

62

Last publish

Collaborators

  • mtokarskivsf
  • dzalewski
  • rickrohrig
  • macryb
  • skirianov
  • wojciechsikora
  • filrak
  • fifciuu
  • lukasborawski