Home > JavaScript API

How to load one widget or another depending on variables

Most of our customers would choose which widget they want to install where, and install them accordingly on those pages. However, if you are running more of a complex operation, where you may want to detect some specific settings to determine which widgets to load, we can help with that!  In that case you may want to load one widget …

READ FULL ARTICLE

Routing by tag for reactive chats: Configuration

Routing by Tag is an advanced feature, available only on Premier or higher 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

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

Gather Additional Information with Javascript Variables

SnapEngage automatically collects data about the visitor you’re chatting with, but sometimes it can be useful to collect additional information that is more specific to your needs.

This additional information is collected in the form of Javascript variables, and can be anything you like, such as; visitor’s logged-in status, the page on your website they’ve visited most, etc.

This information …

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

How to: Google Analytics

Google Analytics is a very powerful tool to track engagement. It can, however, be challenging to set up and make sure events are firing. Please read this doc carefully and feel free to reach out to our support team if you need more help.

We also have another Google Analytics help doc all about tracking events and even gives specific …

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