Only allow chats from logged in visitors
If you only want to show the Olark chat box to visitors who are logged in, you can use this guide to set it up.
Setup Steps
- First you'll need your own server-side script to detect when a visitor is logged in. Create a conditional statement for logged in visitors, which you can then insert the below code into.
- Go to your Setup page and enable the Hide the chatbox by default option. Remember to save your changes!
Use the Javascript API listed below to show the chat box if a visitor is logged in. Here is an example.
Important Notice: We’ll do our best to help with any questions you have. However, please keep in mind that the JavaScript API is intended to be self-serve for web developers, so we’re not able to write or debug your code. If you’re experiencing issues, please be sure to have your developer, designer, or webmaster review the code you’ve written.
Oops! Something went wrong while submitting the form.