diff --git a/src/components/CookiesBanner/index.tsx b/src/components/CookiesBanner/index.tsx index 06fc2bc9..9219aab6 100644 --- a/src/components/CookiesBanner/index.tsx +++ b/src/components/CookiesBanner/index.tsx @@ -129,6 +129,10 @@ const CookiesBanner = (): ReactElement => { } setLocalAnalytics(acceptedAnalytics) setLocalNecessary(acceptedNecessary) + + if (acceptedAnalytics && !isDesktop) { + loadGoogleAnalytics() + } } } fetchCookiesFromStorage() @@ -162,10 +166,6 @@ const CookiesBanner = (): ReactElement => { dispatch.current(openCookieBanner({ cookieBannerOpen: false })) } - if (showAnalytics && !isDesktop) { - loadGoogleAnalytics() - } - if (showIntercom) { loadIntercom() }