← view more API documentation

api.chat.sendNotificationToOperator

Send a notification message to the operator. The operator will see "[info]" to indicate that this message was not sent from the visitor.

  • options.body the contents of the notification to send the operator

Examples

Send the operator a notification when the visitor lands on a particular page, like your billing page:

if (document.location.indexOf('billing') != -1) {
    olark('api.chat.sendNotificationToOperator', {body: 'visitor landed on the billing page'});
}

Maybe you want to notify an operator when a visitor is hesitating on a page for more than 60 seconds so you can choose to initiate a chat with them:

setTimeout(function(){
    olark('api.chat.sendNotificationToOperator', {body: 'this visitor is hesitating'});
}, 60000);

Discussion

Feel free to propose good uses for this method, or even drop us some suggestions for improvement! You can also join our mailing list to collaborate with other developers and get updates from us.