Change GA deprecated code.

This commit is contained in:
Paulo Gustavo Veiga 2022-05-29 16:32:51 -07:00
parent a9bcfce52c
commit 7cb4a93387
6 changed files with 10 additions and 6 deletions

View File

@ -26,7 +26,11 @@ declare module '@mui/styles/defaultTheme' {
} }
// Google Analytics Initialization. // Google Analytics Initialization.
ReactGA.initialize(AppConfig.getGoogleAnalyticsAccount()); ReactGA.initialize([
{
trackingId: AppConfig.getGoogleAnalyticsAccount(),
}
]);
const queryClient = new QueryClient({ const queryClient = new QueryClient({
defaultOptions: { defaultOptions: {

View File

@ -23,7 +23,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
const client: Client = useSelector(activeInstance); const client: Client = useSelector(activeInstance);
useEffect(() => { useEffect(() => {
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.send({ hitType: "pageview", page: window.location.pathname});
}, []); }, []);
const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => { const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => {

View File

@ -80,7 +80,7 @@ const ForgotPasswordPage = (): React.ReactElement => {
const intl = useIntl(); const intl = useIntl();
useEffect(() => { useEffect(() => {
document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' }); document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' });
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.send({ hitType: "pageview", page: window.location.pathname});
},[]); },[]);
return ( return (

View File

@ -70,7 +70,7 @@ const LoginPage = (): React.ReactElement => {
useEffect(() => { useEffect(() => {
document.title = intl.formatMessage({id:'login.page-title',defaultMessage:'Login | WiseMapping'}); document.title = intl.formatMessage({id:'login.page-title',defaultMessage:'Login | WiseMapping'});
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.send({ hitType: "pageview", page: window.location.pathname});
},[]); },[]);
return ( return (

View File

@ -83,7 +83,7 @@ const MapsPage = (): ReactElement => {
id: 'maps.page-title', id: 'maps.page-title',
defaultMessage: 'My Maps | WiseMapping', defaultMessage: 'My Maps | WiseMapping',
}); });
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.send({ hitType: "pageview", page: window.location.pathname});
}, []); }, []);
const mutation = useMutation((id: number) => client.deleteLabel(id), { const mutation = useMutation((id: number) => client.deleteLabel(id), {

View File

@ -165,7 +165,7 @@ const RegistationPage = (): React.ReactElement => {
id: 'registration.page-title', id: 'registration.page-title',
defaultMessage: 'Registration | WiseMapping', defaultMessage: 'Registration | WiseMapping',
}); });
ReactGA.pageview(window.location.pathname + window.location.search); ReactGA.send({ hitType: "pageview", page: window.location.pathname});
},[]); },[]);
return ( return (