I won't find any good documentation for installing Hotjar snippet on REACT where we have multiple components. I want to add a User Attribute for my app which include multiple parameters.

  • What would be the best place for a snippet?
  • How can I deal with the route change?

I have my heatmap setup on the Hotjar website I just want User Attributes for filtering purpose.

1

There are 1 best solutions below

0
On

You can use this package to install the hotjar in your project in react

npm i @hotjar/browser

After this, set the configuration in your app.js and deploy on to the server, and configure the URL on Hotjar.

const siteId = 123;
const hotjarVersion = 6;

Hotjar.init(siteId, hotjarVersion);

// Initializing with `debug` option:
Hotjar.init(siteId, hotjarVersion, {
  debug: true
});