CMS Development

AGrek
メンバー

Visitor identification with auth flow

I have a SPA application. To access the main content, authorization is required. I have connected the HubSpot LiveChat widget.

I want to implement the following:

- If the user is not authorized, the chat is available to them as an "Unknown Visitor."
- If the user is authorized, it is necessary to set the email and token for the chat. I found the following method:

 

window.hsConversationsSettings = {
identificationEmail: "visitor-email@example.com",
identificationToken: "<TOKEN FROM STEP 1>"
};
window.HubSpotConversations.resetAndReloadWidget();

 

 

- If the user logs out, I need to remove their data from the chat. For this, I use the following code:

 

window.HubSpotConversations.clear();

 

Please advise on how to correctly implement this logic.

0 いいね!
0件の返信

0 コメント

この投稿にはまだ回答がありません

この投稿にはまだ回答が寄せられていません。しばらく経ってからもう一度ご確認ください。また、役に立つ情報をご存じの場合はぜひ回答を投稿してください。

投稿に回答する

回答の仕方についてご不明な場合は、コミュニティーのガイドラインをご覧ください。