Skip to content

Commit f3f14fb

Browse files
ayesha-warisAyesha Waris
andauthored
fix: fixed cohesion page url setup (#1476)
Co-authored-by: Ayesha Waris <ayesha.waris@A006-01000.local>
1 parent 6c8b383 commit f3f14fb

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/MainApp.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Helmet } from 'react-helmet';
66
import { Navigate, Route, Routes } from 'react-router-dom';
77

88
import {
9-
EmbeddedRegistrationRoute, NotFoundPage, registerIcons, UnAuthOnlyRoute,
9+
EmbeddedRegistrationRoute, NotFoundPage, registerIcons, RouteTracker, UnAuthOnlyRoute,
1010
} from './common-components';
1111
import configureStore from './data/configureStore';
1212
import {
@@ -57,6 +57,7 @@ const MainApp = () => (
5757
<Route path={PAGE_NOT_FOUND} element={<NotFoundPage />} />
5858
<Route path="*" element={<Navigate replace to={PAGE_NOT_FOUND} />} />
5959
</Routes>
60+
<RouteTracker />
6061
<MainAppSlot />
6162
</AppProvider>
6263
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useEffect } from 'react';
2+
3+
import { useLocation } from 'react-router-dom';
4+
5+
const RouteTracker = () => {
6+
const location = useLocation();
7+
8+
useEffect(() => {
9+
window.tagular?.('pageView');
10+
}, [location]);
11+
12+
return null;
13+
};
14+
15+
export default RouteTracker;

src/common-components/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export { default as RedirectLogistration } from './RedirectLogistration';
22
export { default as registerIcons } from './RegisterFaIcons';
33
export { default as EmbeddedRegistrationRoute } from './EmbeddedRegistrationRoute';
44
export { default as UnAuthOnlyRoute } from './UnAuthOnlyRoute';
5+
export { default as RouteTracker } from './RouteTracker';
56
export { default as NotFoundPage } from './NotFoundPage';
67
export { default as SocialAuthProviders } from './SocialAuthProviders';
78
export { default as ThirdPartyAuthAlert } from './ThirdPartyAuthAlert';

src/logistration/Logistration.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ const Logistration = (props) => {
7171
return;
7272
}
7373

74-
window.tagular?.('pageView');
75-
7674
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement', app_name: APP_NAME });
7775
props.clearThirdPartyAuthContextErrorMessage();
7876
if (tabKey === LOGIN_PAGE) {

0 commit comments

Comments
 (0)