diff --git a/nuxt.config.js b/nuxt.config.js index 2c5359a..7109a3e 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -57,10 +57,9 @@ export default { src: 'https://www.googletagmanager.com/gtag/js?id=G-NDLRBPBQJZ', }, { - innerHTML: `window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-NDLRBPBQJZ');`, + src: '/static/gtag.js', }, ], - __dangerouslyDisableSanitizers: ['script'], link: [ { rel: 'stylesheet', diff --git a/static/gtag.js b/static/gtag.js new file mode 100644 index 0000000..d22d54e --- /dev/null +++ b/static/gtag.js @@ -0,0 +1,9 @@ +window.dataLayer = window.dataLayer || [] + +function gtag() { + dataLayer.push(arguments) +} + +gtag('js', new Date()) + +gtag('config', 'G-NDLRBPBQJZ')