From 63136597dbc681bd75a40e40223e5e2c19b72e66 Mon Sep 17 00:00:00 2001 From: Eric Lakatos Date: Sun, 18 Feb 2024 14:49:19 -0500 Subject: [PATCH] update analytics --- nuxt.config.js | 18 +++++++++++------- static/js/ga.js | 8 ++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 static/js/ga.js diff --git a/nuxt.config.js b/nuxt.config.js index d3d8648..1e7a093 100755 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,6 +1,6 @@ module.exports = { env: { - flushSettings: process.env.FLUSH_SETTINGS || false + flushSettings: process.env.FLUSH_SETTINGS || false, }, /* ** Headers of the page @@ -44,7 +44,16 @@ module.exports = { type: 'image/x-icon', href: '/images/favicons/favicon.ico', }, - ] + ], + script: [ + { + src: 'https://www.googletagmanager.com/gtag/js?id=G-W9T9V40P4Z', + async: true, + }, + { + src: 'js/ga.js', + }, + ], }, /* ** Customize the progress bar color @@ -68,9 +77,4 @@ module.exports = { } }, }, - modules: [/*'~/io', */ '@nuxtjs/google-analytics'], - - 'google-analytics': { - id: 'UA-119957645-1', - } }; diff --git a/static/js/ga.js b/static/js/ga.js new file mode 100644 index 0000000..09ebad5 --- /dev/null +++ b/static/js/ga.js @@ -0,0 +1,8 @@ +window.dataLayer = window.dataLayer || []; + +function gtag() { + dataLayer.push(arguments); +} +gtag('js', new Date()); + +gtag('config', 'G-W9T9V40P4Z');