diff --git a/.github/workflows/deployment-live.yml b/.github/workflows/deployment-live.yml index 43543af..ba83d0f 100644 --- a/.github/workflows/deployment-live.yml +++ b/.github/workflows/deployment-live.yml @@ -24,6 +24,7 @@ jobs: sed -i "s|'test/'|${{ secrets.S3_SUB_FOLDER_LIVE }}|g" src/config.js sed -i "s|${url}u/|${{ secrets.UP_LIVE }}|g" src/config.js sed -i "s|6Le-n9QUAAAAAG-3bYyysXddxwD6I6iJeDBTHf2r|${{ secrets.RECAPTCHA_LIVE }}|g" src/config.js + sed -i "s|hotJarId: 0|hotJarId: ${{ secrets.HOTJAR }}|g" src/config.js - name: Install dependencies run: yarn install --frozen-lockfile diff --git a/package.json b/package.json index d73085f..7b6b3a2 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "@fingerprintjs/fingerprintjs": "^3.4.0", + "@hotjar/browser": "^1.0.9", "@kevinwolf/formal-web": "^0.1.3", "@material-ui/core": "4.11.3", "@material-ui/icons": "^4.11.2", diff --git a/src/app.jsx b/src/app.jsx index fb03de4..f405520 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -1,16 +1,23 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { StoreProvider, createStore } from 'easy-peasy'; import { HelmetProvider } from 'react-helmet-async'; import Router from './router'; import model from './easypeasy'; import { queryClient } from './react-query'; import { QueryClientProvider } from 'react-query'; +import Hotjar from '@hotjar/browser'; +import config from 'config'; const easyPeasyStore = createStore(model, { version: 2, }); function App() { + useEffect(() => { + if (config.hotJarId) { + Hotjar.init(config.hotJarId, 6); + } + }, []); return ( diff --git a/src/config.js b/src/config.js index 5258022..10c5fca 100644 --- a/src/config.js +++ b/src/config.js @@ -14,6 +14,7 @@ const config = { recaptcha: '6Le-n9QUAAAAAG-3bYyysXddxwD6I6iJeDBTHf2r', maxUploadSize: 10485760, s3Url: `https://space.elma.online/${s3SubFolder}`, + hotJarId: 0, }; export default config; diff --git a/yarn.lock b/yarn.lock index bda9ea6..8583e83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2031,6 +2031,11 @@ dependencies: "@hapi/hoek" "^8.3.0" +"@hotjar/browser@^1.0.9": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@hotjar/browser/-/browser-1.0.9.tgz#769b4ded3fa7b9557b785c107f0cd76d3f83789a" + integrity sha512-n9akDMod8BLGpYEQCrHwlYWWd63c1HlhUSXNIDfClZtKYXbUjIUOFlNZNNcUxgHTCsi4l2i+SWKsGsO0t93S8w== + "@icons/material@^0.2.4": version "0.2.4" resolved "https://registry.yarnpkg.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8"