.openProactiveChat()
(Last Updated On: March 12, 2014)
Overview

Manually start SnapEngage’s Proactive Chat.

SnapEngage.openProactiveChat(forced, offlineFallback, msg);



Parameters


forced
Type
Boolean | (Required)
Values
true || false
Description

Should SnapEngage disregard whether or not the visitor has recently closed a chat window? (See here for more info on The 30-minute Proactive Chat Delay Cookie.)

And should SnapEngage disregard whether or not you have “Enable Proactive Chat” checked in your Configurator?

For example, if you’re hooking this function to the onclick event of an <a> tag, you’ll want this set to true because you can assume someone clicking a link does want to chat.


offlineFallback
Type
Boolean | (Required)
Values
true || false
Description

Should this function fallback to the Offline form if live chat is currently unavailable?

For example, if you’re hooking this function to the onclick event of an <a> tag, you’ll want this set to true because you can assume someone clicking a link does want to get in touch with you, and if you’re offline this will give them the option of filling out the offline form.

Alternatively: Be careful using true here, a poor implementation of the .openProactiveChat() function with offlineFallback set to true can be very jarring for your visitors!


msg
Type
String | (Required)
Description

When calling .openProactiveChat() manually, you must manually set a first-message for the Proactive Chat. This message will appear to come from your agent, and will show up wherever you call this manually. So in most cases, the best option is to define a very generic message such as, ‘Thanks for visiting. How can I help you?’