Answered

Hi, we are using segment to integrate intercom in our web portal. We are able to set up identify methods from segment and it works properly. However, how do I reset it if the user logs out? We want to show the chat icon to only logged in users.

  • 21 September 2020
  • 2 replies
  • 167 views

Hi, we are using segment to integrate intercom in our web portal. We are able to set up identify methods from segment and it works properly. However, how do I reset it if the user logs out? We want to show the chat icon to only logged in users.
icon

Best answer by Jeff H12 22 September 2020, 16:40

View original

2 replies

Userlevel 1
Badge

Hi @user310​ ,

 

I Don't fully get your question. You are trying to set-up Intercom with Segment and want to disable messenger for visitors? I'm right?

 

You already set-up user identification? When you are making log-in to your app, it shows up as logged in user in Intercom?

If so, you just need to disable messenger for visitors:

intercom-messenger

 

Is it a single page app?

I've also implemented Intercom using Segment. If Roy's suggestion doesn't work - it may be a Segment thing rather than an Intercom thing.

 

When an identify call is made, the user's ID gets stored in the browser, so Intercom may 'think' that the user is still active even post-logout. Try firing:

 

analytics.reset();

 

when a user logs out, and with the Intercom setting turned off you may get the expected behaviour of the messenger disappearing.

 

Additional Docs:

 

Identify Best Practices:

https://segment.com/docs/connections/spec/best-practices-identify/#when-and-how-often-to-call-identify

 

How to end user sessions:

https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#reset-or-logout

Reply