We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Mar 11, 2020 5:25 AM
Hi folks,
i've read here and tested and changed my code several time, but setting the identity works not 100% of our cases.
The code is
after login
static setChatIdentity = (email) => { if (window.HubSpotConversations) { this.onConversationsAPIReady(email); } else { window.hsConversationsOnReady = [this.onConversationsAPIReady(email)]; } } static onConversationsAPIReady = (email) => { console.log("onConversationsAPIReady", email); setTimeout(() => { var _hsq = window._hsq = window._hsq || []; //_hsq.push(["doNotTrack"]); //_hsq.push(['doNotTrack', {track: true}]); //_hsq.push(["setPath", "/chat"]); //window.HubSpotConversations.clear(); //_hsq.push(["revokeCookieConsent"]); _hsq.push(["identify", { email: email }]); _hsq.push(["trackPageView"]); //window.HubSpotConversations.widget.refresh(); //window.HubSpotConversations.on("conversationStarted", payload => { //_hsq.push(["doNotTrack"]); //}); setTimeout(() => { console.log("refresh", email) _hsq.push(["identify", { email: email }]); _hsq.push(["trackPageView"]); window.HubSpotConversations.widget.refresh(); }, 2000); }, 1000); }
Most of the time, this is working, but that's not enough. And i have no idea, what i must do, to make this more stable.
Has somebody another hint for me?
Mar 19, 2020 9:33 AM
Hey @stundzigs ,
I can totally apreciate your frustration here; based on the description in your post, it sounds like this is behaving as expected. The follow forum post written up by Isaac goes in depth around the nuts and bolts of how the Chat Widget interacts with Visitor Identities. If you have any questions around this that aren't answered in the following post, let me know!
Mar 19, 2020 9:40 AM
Hi Derek,
actually i'm waiting for the fix in your chat implementation. Hopefully this is coming till the end of this month. Is it?
Regards
Steffen...