Skip to content

Commit 8ef6d7d

Browse files
authored
Fix the default redirect logic to always open GA4 (#2244)
* Add screen_view, ad_impression, campaign_details events to EventBuilder * remove UA toggle * Delete UA-GA4 toggle * Redirect the root page to ga4 without breaking the Bitly auth. * Remove LineItem since it is not implemented (fix presubmit failures). * Fix presubmit failures.
1 parent fa16055 commit 8ef6d7d

3 files changed

Lines changed: 7 additions & 42 deletions

File tree

src/components/Layout/GA4Toggle.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/Layout/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { useGAVersion } from "../../hooks"
4141
import { GAVersion, Url } from "../../constants"
4242
import Spinner from "../Spinner"
4343
import { linkData } from "./links"
44-
import GA4Toggle from "./GA4Toggle"
4544
import BugReport from "./BugReport"
4645
import Loadable from "../Loadable"
4746
import useLogin2, { UserStatus } from "./useLogin"
@@ -130,7 +129,12 @@ const Template: React.FC<PropsWithChildren<LayoutProps & TemplateProps>> = ({
130129
const newLocation = window.location.href.replace( window.location.hostname, newHostname );
131130
window.location.replace(newLocation);
132131
}
133-
//}, 1000);
132+
133+
if( !window.location.search && window.location.pathname === '/' ) {
134+
const newLocation = window.location.pathname = '/ga4/';
135+
window.location.replace(newLocation);
136+
}
137+
//}, 1000);
134138

135139
return;
136140
}, []);

src/components/Spinner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react"
22
import { styled } from '@mui/material/styles';
33
import { useTheme } from "@mui/material"
4-
import {Circles} from "react-loader-spinner"
4+
import { Circles } from 'react-loader-spinner'
55
import {PropsWithChildren} from 'react';
66

77
const PREFIX = 'Spinner';

0 commit comments

Comments
 (0)