We want to identify our logged in users to hubspot’s chatbot, so that custom chatflows can be displayed to users based on hubspot segmented lists.
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(["identify", {
email: 'test@test.com'
}]);
_hsq.push(['trackPageView']);
</script>
<script type="text/javascript" id="hs-script-loader" defer src="//js.hs-scripts.com/..."></script>
The code above doesn’t work consistently (sometimes it displays the custom chatbot, sometimes it displays the regular chatbot.)
I think the issue might be related to the hubspot cookies, because after manually clearing them, the custom chatbot loads correctly.
(the cookies being cleared are __hstc, __hssrc, __hssc and hubspotutk)