From 8740d0996715b7da5422457900c947e7f7149850 Mon Sep 17 00:00:00 2001 From: cby3149 Date: Tue, 16 Mar 2021 15:23:43 -0700 Subject: [PATCH] Added GA tag --- public/env.js | 2 +- src/Settings.js | 2 +- src/containers/home/Home.js | 12 ++++++++++++ src/util/config.js | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/public/env.js b/public/env.js index eaa2d0b..e88f0eb 100644 --- a/public/env.js +++ b/public/env.js @@ -1 +1 @@ -window._env = {"NODE_ENV":"development","REACT_APP_SYNC_INTERVAL":"120","REACT_APP_POLL_INTERVAL":"20"}; \ No newline at end of file +window._env = {"NODE_ENV":"development","REACT_APP_SYNC_INTERVAL":"120","REACT_APP_POLL_INTERVAL":"20","REACT_APP_GTM_ID":"GTM-52MKVXM"}; \ No newline at end of file diff --git a/src/Settings.js b/src/Settings.js index 892894d..8a07685 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -4,4 +4,4 @@ export const SERVICE_API_URL = 'https://mg0gv4bmu9.execute-api.us-west-1.amazona export const HASHCAST_API_URL = 'https://hsj4abmlzi.execute-api.us-west-1.amazonaws.com/prod/'; export const WEBSOCKET_API_URL = 'wss://hxpkicwmek.execute-api.us-west-1.amazonaws.com/prod'; -export const VERSION = '1.0.7'; \ No newline at end of file +export const VERSION = '1.0.8'; \ No newline at end of file diff --git a/src/containers/home/Home.js b/src/containers/home/Home.js index 0ed8a6d..f5f5bbf 100644 --- a/src/containers/home/Home.js +++ b/src/containers/home/Home.js @@ -129,6 +129,18 @@ function Home () { useEffect(() => { setPageDisplay("AccountNow"); + if (config.gtmId) { + const scriptTag = document.createElement('script'); + scriptTag.src = `https://www.googletagmanager.com/gtm.js?id=${config.gtmId}`; + scriptTag.async = true; + document.body.appendChild(scriptTag); + const iframeTag = document.createElement('iframe'); + iframeTag.src =`https://www.googletagmanager.com/ns.html?id=${config.gtmId}`; + iframeTag.height = 0; + iframeTag.width = 0; + iframeTag.style = 'display:none;visibility:hidden'; + document.body.appendChild(iframeTag); + } },[]); return ( diff --git a/src/util/config.js b/src/util/config.js index 64395f2..33f6101 100644 --- a/src/util/config.js +++ b/src/util/config.js @@ -20,5 +20,5 @@ export default { pollInterval: env('POLL_INTERVAL'), sentry: env('SENTRY_DSN'), gtmId: env('GTM_ID'), - rpcProxy: env('RPC_PROXY') + rpcProxy: env('RPC_PROXY'), };