feat: adding hotjar support
This commit is contained in:
committed by
leangseu-edx
parent
03e42f45bb
commit
6003099a73
17
src/App.jsx
17
src/App.jsx
@@ -4,6 +4,9 @@ import { useDispatch } from 'react-redux';
|
||||
import { Helmet } from 'react-helmet';
|
||||
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import { logError } from '@edx/frontend-platform/logging';
|
||||
import { initializeHotjar } from '@edx/frontend-enterprise-hotjar';
|
||||
|
||||
import { ErrorPage, AppContext } from '@edx/frontend-platform/react';
|
||||
import Footer from '@edx/frontend-component-footer';
|
||||
import { Alert } from '@edx/paragon';
|
||||
@@ -59,8 +62,18 @@ export const App = () => {
|
||||
window.thunkActions = thunkActions;
|
||||
window.track = track;
|
||||
}
|
||||
});
|
||||
|
||||
if (process.env.HOTJAR_APP_ID) {
|
||||
try {
|
||||
initializeHotjar({
|
||||
hotjarId: process.env.HOTJAR_APP_ID,
|
||||
hotjarVersion: process.env.HOTJAR_VERSION,
|
||||
hotjarDebug: !!process.env.HOTJAR_DEBUG,
|
||||
});
|
||||
} catch (error) {
|
||||
logError(error);
|
||||
}
|
||||
}
|
||||
}, [authenticatedUser, dispatch]);
|
||||
return (
|
||||
<Router>
|
||||
<Helmet>
|
||||
|
||||
Reference in New Issue
Block a user