# Open your chatbot widget when a user is about to leave

Select the chatbot. Go to Settings. Open Behaviour. Here, you will find the
option to open the widget on user leave. Tick this option.






HOW IT WORKS

When the user moves away from the webpage, for example, to a new tab or a new
page, then this change can be detected and the chatbot widget will open. It will
start the conversation and hopefully keep the user on that page.



If the user closes the chatbot widget by pressing the 'X' button, we set a
cookie to prevent it from opening for the same person. In other words, the
auto-open settings will work only for the first time for a new user. It doesn't
work the second time. This is to make the chatbot widget less intrusive.



If you are testing to see if the chatbot widget opens after x seconds, then we
recommend you to test it in the incognito mode of your browser or a different
browser from your current one.



Tip



Don't forget to publish your changes
[https://collect.chat/help/article/1065-how-to-publish-your-form] before
testing.