Skip to main content
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.

  • September 21, 2020
  • 2 replies
  • 224 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.

Best answer by Jeff H12

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

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 21, 2020

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?


  • Connector
  • 9 replies
  • Answer
  • September 22, 2020

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings