@vue-storefront/nuxt-gtag
v1.0.7
Published
<br /> <p align="center"> <img src="./assets/nuxt-gtag.svg" alt="Nuxt GTag" /> </p>
Downloads
127
Readme
#TechForUkraine
Setup
- Add
@vue-storefront/nuxt-gtag
dependency to your project
yarn add @vue-storefront/nuxt-gtag # or npm install @vue-storefront/nuxt-gtag
- Add
@vue-storefront/nuxt-gtag
to themodules
section ofnuxt.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.