Segment allows website owners to collect data via an API and send it to hundreds of marketing, analytics and sales tools including Google Analytics, Salesforce, MailChimp, Intercom... and Hotjar!
Hotjar can be added as a Destination in Segment. This allows you to easily install Hotjar, and instantly send customer data over Hotjar's Identify API without you having to add any additional code.
Complete documentation for setting up Hotjar as a Segment Destination is available on the Segment site.
Using Segment's Identify Spec with the Hotjar Identify API
If you're on a Hotjar Business plan, data you collect over Segment's Identify Spec can be sent as User Attributes to Hotjar. This means you don't need to write additional code to send this data over Hotjar's Identify API. By default, User Attributes are disabled in Hotjar.
User Attributes are facts about your users taken from your site’s data that you can use to more quickly gain insight into the behavior and needs of the users who matter most to your business.
Once enabled, User Attributes allow you to filter Recordings, and target feedback widgets by these values. They also allow you to lookup and delete user data by user ID making it easy to respect your user's privacy rights - which is especially important when passing personal information to Hotjar.
User Attributes are disabled by default.
Once Hotjar has been added as a Destination in Segment, you should enable User Attributes in Hotjar.
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.
We appreciate this might be a frustrating limitation. To see which API improvements we are working on next, check out our Product Roadmap. Every quarter, our Product team reviews, adds and prioritizes what to build next.