react-hotjar
    TypeScript icon, indicating that this package has built-in type declarations

    5.0.0 • Public • Published

    react-hotjar

    Small component to implement Hotjar into your react application

    Installation

    npm install react-hotjar --save

    Use / Example

    import { hotjar } from 'react-hotjar';
    
    hotjar.initialize(hjid, hjsv);
    
    // Identify the user
    hotjar.identify('USER_ID', { userProperty: 'value' });
    
    // Add an event
    hotjar.event('button-click');
    
    // Update SPA state
    hotjar.stateChange('/my/page');
    • hjid: Stands for 'Hotjar ID' - Your site's ID. This is the ID which tells Hotjar which site settings it should load and where it should save the data collected.

    • hjsv: Stands for 'Hotjar Snippet Version' - The version of the Tracking Code you are using. This is only needed if Hotjar ever updates the Tracking Code and needs to discontinue older ones. Knowing which version your site includes allows hotjar team to contact you and inform you accordingly.

    You can learn more from Understanding the Tracking Code of Hotjar docs

    Keywords

    Install

    npm i react-hotjar

    DownloadsWeekly Downloads

    63,522

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    4.88 kB

    Total Files

    6

    Last publish

    Collaborators

    • abdalla