Install the Hotjar Tracking code
All the necessary code will be injected into your site via the setup process in Segment. Your Tracking Code will be injected into your site through Segment.
Send data to Hotjar using our Events API
Segment's Track calls can be automatically forwarded as events to Hotjar through our Events API. We don’t pass any event properties from Segment as Hotjar currently doesn't support them. With our Events API, you can start sending events taking place on your site to Hotjar to help capture specific sessions and filter collected data in Hotjar's tools to improve your insights. For more details, see our article on What Are Events?
For our Observe tools (Heatmaps and Recordings), Events are available on the Observe Business or Observe Scale plans. With the Ask tools (Feedback and Surveys), Events are available on the Ask Plus, Ask Business, or Ask Scale plans. See the Hotjar pricing page for plans and pricing details.
Send data to Hotjar using our Identify API
Data you collect over Segment's Identify Spec can be sent as User Attributes to Hotjar through our Identify API. User Attributes are facts about your users that are sent to Hotjar. You can use them to filter Recording and Heatmap data, create Segments, or show Feedback widgets and Surveys only to specific users. See our What Are User Attributes article to learn more.
Hotjar's Identify API cannot store arrays or objects passed to it
Segment's Identify Spec supports the ability to pass nested objects as data values. Unfortunately, Hotjar's Identify API currently does not and will reject these values.
For our Observe tools (Heatmaps and Recordings), User Attributes are available on the Observe Business or Observe Scale plans. With the Ask tools (Feedback and Surveys), User Attributes are available on the Ask Business, or Ask Scale plans. See the Hotjar pricing page for plans and pricing details.
Complete documentation for setting up Hotjar as a Segment Destination is available on the Segment site.*
*In September 2021, Hotjar made a change so that the User Attributes feature is enabled by default if the feature is included in your Hotjar plan. However, the Segment documentation still mentions the need to enable User Attributes; this step can be ignored.