Provide 24/7 affordable customer service with AI-powered chat.
Connect to learn more

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

  1. 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.
  2. Go to your Setup page and enable the Hide the chatbox by default option. Remember to save your changes!
  3. Use the Javascript API listed below to show the chat box if a visitor is logged in. Here is an example.

    // You need your own method of detecting// whether a visitor is logged inif ($logged_in) {olark('');}

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.

Please provide the domain name where your Olark live chat is installed.
Include the relevant transcript URL, if possible. You can send us the specific URL from your Transcripts page.
If you see specific error messages, banners, warnings, notices, etc., please let us know here.
Max file size 10MB.
Upload failed. Max size for files is 10 MB.
Thank you! Your submission has been received and you'll hear from us shortly!
Oops! Something went wrong while submitting the form.