Article Category: Javascript API


Some users may want to hide the Chat Button initially, then reveal it after X seconds. Here is a little copy-and-paste Javascript snippet you can use to do this. This snippet utilizes the functions: SnapEngage.hideButton() and SnapEngage.showButton().

(This function uses the Advanced Code Snippet and assumes you are using the Chat Button customized in your Configurator’s Style tab.)

Full Article →

In order to set up SnapEngage in a different language other than the one defined in the Configurator, you will need to use the code found under the ‘Advanced‘ section of the ‘Get the Code‘ tab.

You should add the following Javascript code below the  ’// Place your SnapEngage JS API code below’ line:

pic1

 

(for German, …

Full Article →

You have the option to not load SnapEngage on mobile browser pages, if you don’t want to display the chat there.

To do that, you would wrap the your SnapEngage code in a JavaScript “if” statement checking if the visitor is on a mobile browser:

This is how the code block would look on your website:

The code above is …

Full Article →

Awesome proactive 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 know …

Full Article →

You can use the code in the Advanced section of the ‘Get the code’ tab in your configurator:

ADV JS

To preset the description you can add the following code to your widget code where it says, “// Place your SnapEngage JS API code below”:

NOTE: Make sure to click ‘Save’ when you are done making changes.…

Full Article →

The proactive chat minimum delay is set at 15 seconds. We impose this limit because it does not feel realistic to have the proactive chat prompting a visitor with an agent message before this delay.

If you really want to try that though, you can just implement a JavaScript timer calling our JavaScript API, like that:

You should place this …

Full Article →

If you have updated your code since 1/1/2013 then this feature is still in the process of being developed.

If you do not want to be notified when your visitor is changing pages or their page is being reloaded then you have to activate it on your website by changing the /snapabug.js in the SnapEngage JavaScript code section to /snapengage-faq.js…

Full Article →

Please note: this document is now considered obsolete.

If you have not updated your SnapEngage code since January 1st, 2013:
We highly recommend you update to the newer, better, faster, stronger version of the code by going to the “Get the code” tab in your Configurator, and replacing your old code with the new one.


 

This post provides the …

Full Article →

You can gather additional information with our JavaScript variable instrumentation and some JS scripting on your server.

The way it works is that, in the dashboard ‘Options’ tab ->’ JavaScript variable’ you setup the variable you want SnapEngage to instrument and capture when a chat starts. These can be global scope variables, or specific object methods you want SnapEngage to …

Full Article →

Please note: this document is now considered obsolete.

If you have not updated your SnapEngage code since January 1st, 2013:
We highly recommend you update to the newer, better, faster, stronger version of the code by going to the “Get the code” tab in your Configurator, and replacing your old code with the new one.


 

This short document provides …

Full Article →

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 such as the engagement is not done by the timer but by the API call.

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

Full Article →

You can programmatically send text to the agent when a chat is in progress by calling the following API function:

If this function is called when no chat is in progress, the call is ignored.…

Full Article →

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.

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

Full Article →

To change the default position of the chat window add one of the following lines to the SnapEngage JavaScript advanced widget section of the code after the line:

//Place your SnapEngage JS API Code below

For top left positioning of the chat window:

For top right positioning of the chat window:

For bottom left positioning of the chat window:

For …

Full Article →

1) To allow multiple widgets on the same page you would fist install a widgets code on your website (if you are using proactive chat then use this  one).

Here select the “No Image” option in the Style tab of your widget settings, for both the online and offline buttons:


2) Then go to the “Advanced” section and get the …

Full Article →

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

Full Article →

You can hide the screenshot option on the pre-chat dialog by adding the following call to the advanced code just after the line

// Place your SnapEngage JS API code below

(or if you have not updated your code since 1/1/2013 then just before SnapABug.addButton(…) or SnapABug.init(…) )

This call will remove the checkbox from the form, but will still allow …

Full Article →

You can dhave your chat communications encrypted with this setting in the Style tab of your widget settings:

If you are using the old JavaScript code method instead, you can update the SnapEngage code on your page or just add a call to:

in the SnapEngage JavaScript section. This call will force all the communications between the visitor and our

Full Article →

Love coding and want to get your Agents status with an API? Well, you are in luck!

Here is how it works:

You can call this new API with a parameter as a function pointer which takes a boolean argument where we will provide you with the chat team online status. The check is asynchronous. After the getAgentStatusAsync() is done, …

Full Article →

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

// Place your SnapEngage JS API code below

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 SnapABug.addButton(…) or SnapABug.init(…).

Full Article →

To fix the position of your chat box, just add a call to:

in the SnapEngage JavaScript section where 40 should be replaced by the distance in pixel from the top of the page. Fixing the position of the SnapEngage dialog from the top of the page is especially useful when your web application is rendered inside an iFrame, on

Full Article →

You can activate this option in the “Style” tab of your widget settings.

When your visitor clicks a button to chat with you, you can skip the pre-chat form and go straight to the Live Chat instead by flipping this switch in your Configurator:

no-pre-chat

You also have the option to define your initial chat message here. For example, something like, …

Full Article →

To disable the screenshot feature use the SnapEngage JavaScript advanced widget code code from the get the code tab and after the line:

//Place your SnapEngage JS API Code below

add the code:

The screenshot option will no longer be displayed on the form, and the live support agent will not be allowed to request a remote screenshot while in …

Full Article →

You can deactivate the “Email us” button on your pre-chat form if your agents area available with this setting in the Style tab of your widget settings:

 

 

If you are using the old JavaScript code method instead, you can update the SnapEngage code on your page or just add a call to:

in the JavaScript section. This API …

Full Article →

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.

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

Full Article →

*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

Full Article →

Overview

You can use the SnapEngage JavaScript event API to track various events with Google Analytics. You can track most of the events documented in the the Javascript Event API, which is available on our Developer API site.


First, you’ll need the “Advanced” Code Snippet

In order to use Google Analytics event tracking, you’ll need to use the “Advanced” …

Full Article →

To continue a chat session across subdomains, just go to the Style tab of your Configurator and select ‘Enable chat session to continue across sub-domains of your site’.

00000097

Be sure to enter your domain without the www. like: domain.com

If you are using the old JavaScript code method instead, you can update the SnapEngage code on your page or just …

Full Article →

To pre-se the email address, just add a call to:

in the SnapEngage JavaScript section where [email protected] should be replaced by your user email address. The easiest way to set the email address would be from your server side scripting, but doing it from JavaScript is also possible.

 

If you would like to have the pre-set email address read …

Full Article →