If you only embed the Olark code on a single page, chats would end as soon as the visitor navigated away. Instead, you can use our Javascript API.

Include the Olark embed code on every page as usual, but hide the chat box on every page except the one on which you’d like visitors to reach out to you, such as a contact page. To hide the chatbox, add the following snippet after the Olark install code on the appropriate pages:

<script type='text/javascript'>
olark('api.box.hide');
olark('api.visitor.getDetails', function(details){
    if (details.isConversing) {
        olark('api.box.show');
    }
});
</script>

You can also use our Automation rules to do the same thing without altering the code on your website.

You would first enable Inivisble Olark on our Advanced Settings page, then configure a Targeted Chat rule to look at the Current URL and show or expand the widget on that page.