# Hotjar

[Hotjar](https://www.hotjar.com/) is a popular [behavioral analytics](https://www.rudderstack.com/learn/data-analytics/what-is-behavioral-analytics/) platform, suitable for marketing teams and product managers to better understand and improve their product. It allows them to understand the behavior of their website's visitors through heat maps, surveys, and conversion funnels.

RudderStack helps you integrate your website with Hotjar to auto-track your user data.

## Connection compatibility

{{< destination-config >}}

{{< info >}}
In the web device mode integration, that is, using [JavaScript SDK]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/_index.md" >}}) as a source, RudderStack loads the Hotjar native SDK from the`https://static.hotjar.com/` domain.

Based on your website's content security policy, you might need to [allowlist this domain]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk.md#allowlist-destination-domain" >}}) to load the Hotjar SDK successfully.
{{< /info >}}

## Get started

Once you have confirmed that Hotjar supports the source, perform the steps below:

- From your [RudderStack dashboard](https://app.rudderstack.com/), add the source. Then, select **Hotjar** from the list of destinations.
- Assign a name to your destination and click **Next**. You should see the following screen:

{{< image src="images/event-stream-destinations/hotjar-connection-settings.webp" alt="Hotjar connection settings" >}}

### Connection settings

To successfully configure Hotjar as a destination in RudderStack, enter the following connection settings:

- **Site ID**: Enter your Hotjar site ID. You can get your site ID by logging into your Hotjar account and navigating to **Settings** > **Sites & Organizations**.

Finally, click **Next** to complete the configuration. Hotjar will now be added and enabled as a destination in RudderStack.

## Track

The `track` call leverages Hotjar's [Events API](https://help.hotjar.com/hc/en-us/articles/4405109971095) to track specific user actions.

A sample `track` call is as shown below:

```javascript
rudderanalytics.track("custom_event");
```

{{< info >}}
To use the Hotjar Events API, you must be on Hotjar's Plus, Business, or Scale plans.
{{< /info >}}

## Identify

The `identify` call lets you pass your user data to Hotjar, sending them as [User Attributes](https://help.hotjar.com/hc/en-us/articles/4402892526487-What-are-User-Attributes-).

{{< warning >}}

Before you start making `identify` calls, make sure that [User Attributes](https://insights.hotjar.com/settings/user-attributes) are enabled in your Hotjar dashboard for each site. Refer to this [Hotjar support page](https://help.hotjar.com/hc/en-us/articles/360033640653-Identify-API-Reference#making_calls_to_identify) for more information on enabling and disabling User Attributes.
{{< /warning >}}

A sample `identify` call is shown below:

```javascript
rudderanalytics.identify("userId", {
  total_spend: 500
});
```



