Adding a Click-to-Chat Link
Being able to make any image or link bring up the Olark chat box lets you highlight your live chat service anywhere on your site. As with all the examples below, we recommend enabling the "Hide the chatbox by default" option so that your chat box is hidden until someone clicks the link.
Note: You need to be on a paid account in order to enable Hide the chatbox by default setting.
If you send a message to your visitor, either as an agent or using an Automation Rule, the chat box will automatically appear and expand itself.
This article contains four short guides with examples.
Click-to-Chat Link
This click-to-chat link makes use of the Olark Javascript API. You can modify or hide the link itself when your agents are away by using the api.chat.onOperatorsAway call.
- Copy the following HTML code:
- Paste the code in to your website source anywhere between the two body tags.
- Save your page and reload.
It should look something like this:
Click-to-Chat Image
- Copy the following HTML code:
- Note: You can find the Site ID for your account here.
- Place this code where you want your image to appear. The links to the images should be after online= and offline= in the src attribute.
- Save your page and reload.
It should look something like this:
Note: If you'd like your images to display differently based on online/offline status, you can use the following code:
After you insert your Site ID where it shows, "YOUR_SITE_ID", you can reference the image file path after online=. You can use offline= for an offline image file.
Chat Side Tab
You can add a click-to-chat tab to the side of your page. Remember, you can use your own custom image or change the position by modifying this code.
- Copy the following HTML and CSS code:
- Paste the code in to your website source anywhere between the two body tags.
- Include the following CSS either in your HTML document or your CSS stylesheet. If including in your CSS stylesheet, the <style> and </style> tags are not needed:
- Save your page and reload.
Chat Side Tab (CSS Only)
If you want to use a solution that does not require any images, you can use CSS to position a click-to-chat tab on the side of your page.
Note: This method uses CSS3 which may not work on older browsers.
- Copy the following HTML code.
- Paste the code in to your website source anywhere between the two body tags.
- Include the following CSS either in your HTML document or your CSS stylesheet. If including in your CSS stylesheet, the <style> and </style> tags are not needed.
- Save your page and reload. It should look something like this example.