NAV
javascript

.openProactiveChat()

// Do not open proactive chat if the user has recently
// closed a proactive invite
var forced = false;

// Do not open the offline box if the widget is not online
var offlineFallback = false;

// Do not open the offline box if the widget is not online
var message = 'Hey there! How can I help you today?';

// Regular chat box
var minimizedView = false; 

// Call the API with the above parameters
SnapEngage.openProactiveChat(forced, offlineFallback, message, minimizedView);

Manually open a proactive message.

Parameters

Parameter Type Description
forced boolean 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 Admin Dashboard Proactive Settings tab? For example, if you're hooking this function to the onclick event of an tag, you'll want this set to true because you can assume someone clicking a link does want to chat.
offlineFallback boolean 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 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!
message String When calling .openProactiveChat() manually, you can also set a first message for the Proactive Chat. Otherwise the Proactive Chat message will fall back to the first available message from the Proactive Chat configuration of the widget. 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?"
minimizedView boolean Should the visitor be prompted with the minimized Proactive Chat invite? See here for more info on minimized Proactive Chat. When no programmatic message is set in this prompt, the previous parameter should be set to 'undefined'.