Home > JavaScript API

Routing by Tag Configuration

Routing by Tag is an advanced feature, available only on Premier Accounts, which enables routing of chats to the most appropriate agent based on skill-set, language, specialty etc. Setting up this feature requires configuration in the SnapEngage Admin Dashboard and can also be used in conjunction with functions inserted into your website code.

Step 1. Enable the Feature

To …

READ FULL ARTICLE

How do I adjust the time before the proactive chat window automatically closes?

Awesome proactive chat engagement is something that we pride ourselves in here at SnapEngage.  However, when we implemented the proactive chat feature, we went off the assumption that if a visitor wasn’t called to action within a minute or two, they probably weren’t interested in initiating a chat, and consequently, we programmed the proactive chat window to automatically disappear.  We …

READ FULL ARTICLE

How do I pre-populate the “Your question” field in the pre-chat form?

You can pre-populate the “Your question” field in the Pre-Chat Form. The message will still be fully configurable by your Visitor.

To pre-populate this field you can add the following code to your widget code where it says, “// Place your SnapEngage JS API code below”:

READ FULL ARTICLE

Gather Additional Information with JavaScript Variables

During a chat with a customer, SnapEngage will collect all sorts of information about the customer, their environment and the chat itself. If there is any additional information you would like to gather, you can do this using a prechat form or by using formulas to define new variables in your SnapEngage code on your site (JavaScript Variables)!

Prechat Form

READ FULL ARTICLE

How do I programmatically start the proactive chat on some pages?

You will have to setup a rule (or some rules) that matches the URLs for these pages and therefore have a proactive chat message prompt defined. The delay should be long enough so that the engagement is not done by the timer but instead by the API call.

Just make this call from your JavaScript logic to start a proactive …

READ FULL ARTICLE

How do I open the chat window programmatically?

Overview

There are a few ways to start a chat using our Javascript API’s after you have the SnapEngage code installed on your website. Your usage may depend on exactly what you’re hoping to do, but in most cases we recommend using the following.

You can make this a call from a …

READ FULL ARTICLE

How do I programmatically disable the proactive chat for some users I know are already converted?

To disable proactive chat for converted visitors you can place the following line in the SnapEngage JavaScript code after the line:

// Place your SnapEngage JS API code below

SnapEngage.allowProactiveChat(false);

Note: If you have not added or updated your code since January 1st, 2013 then you will want to add the above line after the SnapEngage.addButton(…) or SnapEngage.init(…).

READ FULL ARTICLE

JavaScript event API documentation

*Note: Please see the updated Javascript Event Documentation here.


List of Events:

Open:
usage: called when the user opens the form on a button click, through an API call to startLink(), startChat(), etc.
parameters:
– agent online/offline with the string value ‘online’ or ‘offline’

OpenProactive: 
usage: called when the proactive chat starts
parameters:
– agent

READ FULL ARTICLE

Set the email address for pre-chat form or start of chat

Have a returning visitors or customers coming to your site frequently? You can pre-set the email address of a known user or users using our JavaScript API. This will permit you to pre-populate the email field on a pre-chat form or if you are not using that, it will pass the email address of the visitor over to the agent …

READ FULL ARTICLE