Skip to content

Commit

Permalink
Merge pull request #268 from edx/trhodes/ent-3829
Browse files Browse the repository at this point in the history
feat: enable hotjar metrics
  • Loading branch information
taliaedX authored May 28, 2021
2 parents 955b48c + 402129e commit 832a556
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ FEATURE_ENROLL_WITH_CODES='true'
FEATURE_LANGUAGE_FACET='true'
FEATURE_PROGRAM_TITLES_FACET='true'
SHOW_MAINTENANCE_ALERT=''
HOTJAR_APP_ID=2426588
HOTJAR_VERSION=6
HOTJAR_DEBUG=true
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"react-router-redux": "5.0.0-alpha.9",
"react-transition-group": "4.4.1",
"react-truncate": "2.4.0",
"react-use-hotjar": "^1.1.2",
"redux": "4.0.5",
"redux-devtools-extension": "2.13.8",
"redux-logger": "3.0.6",
Expand Down
9 changes: 8 additions & 1 deletion src/components/app/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import React, { useEffect } from 'react';
import { Switch } from 'react-router-dom';
import useHotjar from 'react-use-hotjar';
import { AppProvider, AuthenticatedPageRoute, PageRoute } from '@edx/frontend-platform/react';

import NotFoundPage from '../NotFoundPage';
Expand All @@ -15,6 +16,12 @@ import { LicenseActivationPage } from '../license-activation';
import store from '../../store';

export default function App() {
if (process.env.HOTJAR_APP_ID) {
const { initHotjar } = useHotjar();
useEffect(() => {
initHotjar(process.env.HOTJAR_APP_ID, process.env.HOTJAR_VERSION, process.env.HOTJAR_DEBUG);
}, [initHotjar]);
}
return (
<AppProvider store={store}>
<Switch>
Expand Down

0 comments on commit 832a556

Please sign in to comment.