Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Hotjar Destination


Destination Info
  • Accepts Identify and Track calls.
  • Refer to it as Hotjar in the Integrations object
Connection Modes
Device-modeCloud-mode
Web Web
Mobile Mobile
Server Server

Hotjar(link takes you to an external page) enables you to understand your users in a fast and visual way. Hotjar offers a full set of tools such as analytics, page heatmaps, session recordings, feedback tools, and more. Hotjar provides you with everything your team needs to uncover user insights and make the right product changes.

The Segment Hotjar Destination allows you to get started with Hotjar and its core APIs. You can:

  1. Automatically install the Hotjar Tracking Code(link takes you to an external page).
  2. Automatically send user attributes(link takes you to an external page) to Hotjar by connecting your Segment identify calls with Hotjar's own Identify API.
  3. Automatically send custom events(link takes you to an external page) to Hotjar by connecting your Segment track calls with Hotjar's own Events API.

Knowing who your users are and what they're doing unlocks more advanced filtering and targeting capabilities across all of Hotjar's tools, helping you find meaningful insights faster.


Getting Started

getting-started page anchor
  1. Navigate to Connections and click Add Destination From the Segment web app.
  2. Search for Hotjar in the Catalog, select it, and choose the JavaScript source you want to connect the destination to.
  3. Add your Hotjar Site ID to your Destination settings. You can find this ID in Account settings > Sites & Organizations.

Your changes will appear in the Segment CDN after 45 minutes, and then Analytics.js will start to asynchronously load Hotjar's tracking snippet and send data. If you're already using Hotjar, remove Hotjar's snippet from your code.


The Hotjar destination will automatically ingest a User ID and any values sent over your Identify spec as traits, as long as session capture is enabled in Hotjar.

Identify calls that do not have a User ID value will not be sent to Hotjar.

Nested values or lists

nested-values-or-lists page anchor

Currently, the Hotjar Identify API does not support ingesting values passed as nested objects or lists over your identify Spec:

1
"traits": {
2
"name": "Peter Gibbons",
3
"email": "peter@example.com",
4
"plan": "premium",
5
"logins": 5,
6
"address": {
7
"street": "6th St",
8
"city": "San Francisco",
9
"state": "CA",
10
"postalCode": "94103",
11
"country": "USA"
12
}
13
}

In the example above, Hotjar rejects all the values in the address field.


The Hotjar destination automatically ingests any user actions tracked over your Track spec as events, as long as session capture is enabled in Hotjar.

Currently, the Hotjar Events API does not support ingesting event properties:

1
analytics.track("Experiment Viewed", {
2
experiment_id: "1234",
3
experiment_name: "new_upsell_UX",
4
variation_id: "1234b",
5
variation_name: "variant"
6
});

In the example above, Hotjar only ingests the event name, Experiment Viewed. All of its event properties are rejected.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
Site IDstring
required

This is your site ID for HotJar. It should be a whole number, such as 123456.


IE9 Placeholder Polyfillboolean

Optional

HotJar loads a polyfill for placeholder tags on input fields for IE9. Disable this if you already use a placeholder plugin. https://docs.hotjar.com/v1.0/docs/disabling-placeholder-polyfill

This has been deprecated by Hotjar

Default: true