From ef540e4bcad23866fd52ab542310fd5a95988a37 Mon Sep 17 00:00:00 2001 From: negar Date: Fri, 31 May 2019 13:25:03 +0800 Subject: [PATCH 1/2] send theme on change --- .../app/App/Containers/SettingsDialog/settings-theme.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx b/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx index e59d4a0cf04f..1d06b1a7c1d7 100644 --- a/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx +++ b/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx @@ -4,12 +4,14 @@ import Localize from 'App/Components/Elements/localize.jsx'; import DarkModeIcon from 'Images/app/settings/img-theme-dark.svg'; import LightModeIcon from 'Images/app/settings/img-theme-light.svg'; import { connect } from 'Stores/connect'; +import GTM from 'Utils/gtm'; const ThemeSelectSettings = ({ is_dark_mode, toggleDarkMode, updateBarrierColor }) => { const darkOnClick = () => { if (!is_dark_mode) { const new_dark_mode = toggleDarkMode(); updateBarrierColor(new_dark_mode); + GTM.pushDataLayer({ theme: 'dark' }); } }; @@ -17,6 +19,7 @@ const ThemeSelectSettings = ({ is_dark_mode, toggleDarkMode, updateBarrierColor if (is_dark_mode) { const new_dark_mode = toggleDarkMode(); updateBarrierColor(new_dark_mode); + GTM.pushDataLayer({ theme: 'light' }); } }; return ( From 4e863e774434b2cd30cb4f52af9bc8c9d58f37fc Mon Sep 17 00:00:00 2001 From: negar Date: Fri, 31 May 2019 13:28:42 +0800 Subject: [PATCH 2/2] send event name --- .../app/App/Containers/SettingsDialog/settings-theme.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx b/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx index 1d06b1a7c1d7..38cc74046808 100644 --- a/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx +++ b/src/javascript/app/App/Containers/SettingsDialog/settings-theme.jsx @@ -11,7 +11,7 @@ const ThemeSelectSettings = ({ is_dark_mode, toggleDarkMode, updateBarrierColor if (!is_dark_mode) { const new_dark_mode = toggleDarkMode(); updateBarrierColor(new_dark_mode); - GTM.pushDataLayer({ theme: 'dark' }); + GTM.pushDataLayer({ event: 'switch theme' }); } }; @@ -19,7 +19,7 @@ const ThemeSelectSettings = ({ is_dark_mode, toggleDarkMode, updateBarrierColor if (is_dark_mode) { const new_dark_mode = toggleDarkMode(); updateBarrierColor(new_dark_mode); - GTM.pushDataLayer({ theme: 'light' }); + GTM.pushDataLayer({ event: 'switch theme' }); } }; return (