diff --git a/azure-pipelines.yml b/azure-pipelines.yml index caca6e33..7aa73313 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,5 +78,8 @@ stages: appDeployVariables: __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) cfDistributionId: $(cfDistributionId) \ No newline at end of file diff --git a/public/index.html b/public/index.html index 3e5a1396..5f556395 100644 --- a/public/index.html +++ b/public/index.html @@ -1,6 +1,10 @@ + + @@ -8,6 +12,12 @@ <%= htmlWebpackPlugin.options.title %> + + + diff --git a/vue.config.js b/vue.config.js index 97730661..f5be82e4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,6 +1,12 @@ process.env.VUE_APP_CONSUMER_CF_DISTRO ="https://digitalapi.dev.safelite.io"; process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost"; + +// GA & GTM +// NOTE: Using the old ISS site GTM Cotnainer ID for now, will create a new one soon. +process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=amlAYNhxUxuskQo7jmjadg>m_preview=env-38>m_cookies_win=x';f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-KKNWZ3');"; +process.env.VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC = "https://www.googletagmanager.com/ns.html?id=GTM-KKNWZ3>m_auth=amlAYNhxUxuskQo7jmjadg>m_preview=env-38>m_cookies_win=x"; + module.exports = { publicPath: "/", css: { diff --git a/vue.release.config.js b/vue.release.config.js index 49511e62..93af085c 100644 --- a/vue.release.config.js +++ b/vue.release.config.js @@ -1,6 +1,10 @@ process.env.VUE_APP_CONSUMER_CF_DISTRO = "__VUE_APP_CONSUMER_CF_DISTRO__"; process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__"; +// GA & GTM +process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__"; +process.env.VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC = "__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__" + module.exports = { publicPath: "/", css: {