Is it possible to load self-hosted GoogleTagManager script? #387
Replies: 3 comments 2 replies
-
|
You can just provide the const { proxy } = useScriptGoogleTagManager({
id: 'YOUR_ID' // id is only needed if you haven't configured globally
}, {
bundle: true
})Checkout the docs here https://scripts.nuxt.com/docs/guides/bundling |
Beta Was this translation helpful? Give feedback.
-
|
hi @harlan-zw , if I understand correctly, the requirement of @IdreesSamadi is, we want an option to override the script src here src: withQuery('https://www.googletagmanager.com/gtm.js', {
...
}),so use own self-hosted script 'https://example.com/gtm.js' instead of 'https://www.googletagmanager.com/gtm.js' See other package did: import { createApp } from 'vue';
import { createGtm } from '@gtm-support/vue-gtm';
const app = createApp(App);
app.use(
createGtm({
...
source: 'https://customurl.com/gtm.js', // Add your own serverside GTM script
...
})
) |
Beta Was this translation helpful? Give feedback.
-
|
You can override the source via useScriptGoogleTagManager(
{ id: 'GTM-XXX' },
{ scriptInput: { src: 'https://example.com/gtm.js' } }
)The proxy + |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some of the other analytics Umami and Matomo allow you to load the self-hosted versions. Is this possible for Google Tag Manager?
I am self-hosting the Google Tag Manager, and want to provide the URL to
useScriptGoogleTagManager. Something like the following:Beta Was this translation helpful? Give feedback.
All reactions