mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 04:17:13 +00:00
feat(all): add hotjar
This commit is contained in:
@@ -86,6 +86,10 @@ module.exports = {
|
||||
// GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX
|
||||
id: 'G-WLLB5E14M6' // Please remove this and use your own tag id
|
||||
},
|
||||
hotjar: {
|
||||
id: 1234567, // Please remove this and use your own id
|
||||
snippetVersion : 6 // hotjar snippet version, defaults to 6
|
||||
},
|
||||
themeConfig: {
|
||||
default: 'light',
|
||||
|
||||
|
||||
10
src/helpers/setupHotjar.js
Normal file
10
src/helpers/setupHotjar.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { hotjar } from 'react-hotjar';
|
||||
import config from "./../config";
|
||||
|
||||
export function setupHotjar() {
|
||||
if (config.hotjar?.id) {
|
||||
let snippetVersion = config.hotjar?.snippetVersion ? config.hotjar?.snippetVersion : 6;
|
||||
|
||||
hotjar.initialize(config.hotjar.id, snippetVersion);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import reportWebVitals from './reportWebVitals';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { ThemeProvider } from './contexts/ThemeContext';
|
||||
import { LoadingProvider } from './contexts/LoadingContext';
|
||||
import { setupHotjar } from './helpers/setupHotjar';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
@@ -21,3 +22,4 @@ ReactDOM.render(
|
||||
);
|
||||
|
||||
reportWebVitals();
|
||||
setupHotjar();
|
||||
|
||||
Reference in New Issue
Block a user