Skip to content

Commit

Permalink
Merge pull request #14 from ianpherbert/hotjar
Browse files Browse the repository at this point in the history
install hotjar
  • Loading branch information
ianpherbert authored Mar 27, 2024
2 parents 35698ee + 715865c commit 7d665bf
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 74 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
VITE_MAPBOX_STYLE=${{ secrets.VITE_MAPBOX_STYLE }}
VITE_TRAVEL_ENDPOINT=${{ secrets.VITE_TRAVEL_ENDPOINT_PROD }}
VITE_UNSPLASH_CLIENT_ID=${{ secrets.VITE_UNSPLASH_CLIENT_ID }}
VITE_HOTJAR_ID=${{ secrets.VITE_HOTJAR_ID }}
VITE_ENV=PROD
prepare-deployment-package:
Expand Down
150 changes: 78 additions & 72 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@hotjar/browser": "^1.0.9",
"@mui/icons-material": "^5.15.3",
"@mui/material": "^5.15.3",
"@mui/material": "^5.15.14",
"@mui/x-date-pickers": "^6.19.5",
"@reduxjs/toolkit": "^2.0.1",
"date-fns": "^3.3.1",
Expand Down
7 changes: 7 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import store from './redux/store.ts'
import TestPage from './pages/TestPage.tsx'
import ExplorePage from './pages/ExplorePage.tsx'
import GdprPage from './pages/GdprPage.tsx'
import Hotjar from '@hotjar/browser';
import { environment, hotjarSiteId, hotjarVersion } from './variables.ts'

export const endPoints = {
home: { entrypoint: "" },
Expand All @@ -36,6 +38,11 @@ const router = createBrowserRouter([
},
]);


if (environment === "PROD") {
Hotjar.init(hotjarSiteId, hotjarVersion);
}

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Provider store={store}>
Expand Down
4 changes: 3 additions & 1 deletion src/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const travelEndpoint = import.meta.env.VITE_TRAVEL_ENDPOINT;
export const unsplashClientId = import.meta.env.VITE_UNSPLASH_CLIENT_ID;
export const unsplashBaseUrl = "https://api.unsplash.com";
export const environment = import.meta.env.VITE_ENV;
export const GDPRCookie = "gdprConsent"
export const GDPRCookie = "gdprConsent"
export const hotjarSiteId = import.meta.env.VITE_HOTJAR_ID ?? "";
export const hotjarVersion = 6;

0 comments on commit 7d665bf

Please sign in to comment.