From bf847a78d4e48ed220f176244659192274afa1a5 Mon Sep 17 00:00:00 2001 From: xesf Date: Sat, 29 Jul 2023 20:32:06 +0100 Subject: [PATCH] adding google analytics v4 --- devserver.js | 3 ++- main.jsx | 5 +++-- src/game/SceneManager.ts | 6 +++--- utils/build-index.js | 4 +++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/devserver.js b/devserver.js index b8913e0ff..d4a6c405d 100644 --- a/devserver.js +++ b/devserver.js @@ -126,7 +126,8 @@ app.use('/doc', express.static('./doc')); app.use('/webxr-assets', express.static('./node_modules/@webxr-input-profiles/assets/dist/profiles')); const indexBody = renderToStaticMarkup(React.createElement(Main, { - script: 'window.ga=function(){};\nwindow.isLocalServer=true;', + scriptTag: '', + script: 'window.gtag=function(){};\nwindow.isLocalServer=true;', crashReportUrl: '/crash' })); diff --git a/main.jsx b/main.jsx index f1ea53290..6badccc7c 100644 --- a/main.jsx +++ b/main.jsx @@ -1,6 +1,6 @@ const React = require('react'); -module.exports = ({script, crashReportUrl}) => ( +module.exports = ({scriptTag, script, crashReportUrl}) => ( @@ -12,7 +12,8 @@ module.exports = ({script, crashReportUrl}) => ( LBA2