Home > JavaScript API

Routing by Tag Configuration

THIS FEATURE IS AVAILABLE ON PREMIER ACCOUNTS

Routing by Tag is an advanced feature which enables routing of chats to the most appropriate agent based on skill-set, language, speciality, etc. Setting up this feature requires configuration in the SnapEngage Admin Dashboard and possibly on the javascript of your website.

1. Enable the feature

This is done by signing into your …

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”:

SnapEngage.setDescription('I would like to know about your awesome product...');

 

preset description

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 clear all SnapEngage cookies when my user logs out of my site?

Add a call to the following SnapEngage API function whenever you would like the cookies to be deleted.

SnapEngage.clearAllCookies();

Example

You might have a simple Sign Out link that runs a function from the <a onclick="" event.

<a href="#" onclick="exampleSignOut()">Sign Out</a>

Then you would just add the above-mentioned function into your exampleSignOut() function.

function exampleSignOut() {
    ...
    SnapEngage.clearAllCookies();
    ...
}
READ FULL ARTICLE

How do I open the chat window programmatically?

Overview

There are a few ways to start a chat with our Javascript API 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.

SnapEngage.openProactiveChat();

You can make this call from a JavaScript function, or hook it onto the “onclick” …

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 should 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

How do I start a chat from a link on my page, without using the help button?

In addition to copying the SnapEngage code to the page, you can add an onclick attribute to any HTML tag to open the SnapEngage window when a click on this element is performed.

onclick="SnapEngage.startLink();"

If you want to make a link in your content open SnapEngage, here is an example of how you could do that:

<a href="#" onclick="SnapEngage.startLink();">Chat with 

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 returning visitors or customers coming to your site frequently? You can pre-set the email address of known 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 on to the agent at the start of …

READ FULL ARTICLE