Home > JavaScript API

Track Messaging & Live Chat Events with GA4

Google Analytics is a tool that identifies trends in the visitor’s interaction with the chat application on a given website. Analytics uses a tracking property to measure events or interactions like opening and minimizing the chat box. Our event tracking code corresponds to Google Analytic’s three tracking properties (gtag, ga, and _gaq).

However, Google will fully migrate from the Universal …

READ FULL ARTICLE

Dynamic Proactive Messages Using JavaScript Variables

About This Article

This article explains how set a dynamic proactive message.

Dynamic Proactive (and Bot) Messages.

Proactive chat is a great way to increase engagement with your visitors and clients. The most engagement occurs when you make your messages highly contextual and personalized. Making your messages dynamic (with variable content) is a way to make these messages even more …

READ FULL ARTICLE

FAQ Google Analytics

About This Article

This article clarifies commonly asked questions about Google Analytics.

My SnapEngage events are not being tracked in Google Analytics

Check your website to see if the Google Analytics events and SnapEngage code have been added correctly. Be sure that the Google Analytics Global Tracking Code is added directly below the SnapEngage code.

Are you using the same …

READ FULL ARTICLE

How to load one widget or another depending on variables

About this Article-

This article goes over how to load a different widget based off 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 …

READ FULL ARTICLE

Routing by tag for reactive chats: Configuration

About This Article

This article explains how to use routing by tag, which is used to route.

Routing by Tag is an advanced feature, available only on Enterprise 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 …

READ FULL ARTICLE

Hide the Chat Button, then Reveal the Chat Button after X seconds.

About This Article

The purpose of this article is to provide a comprehensive overview of how to hide the Chat Button, then Reveal the Chat Button after X seconds.

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 …

READ FULL ARTICLE

How to remove Chat for visitors on mobile devices

About This Article

The purpose of this article is to provide a comprehensive overview of how to remove Chat for visitors on mobile devices.

 

While a significant amount of website visitors now use mobile devices, you might not want to offer chat to visitors on your website using mobile devices. That is why you have the option to not …

READ FULL ARTICLE

Gather Additional Information with Javascript Variables

About This Article

The purpose of this article is to provide a comprehensive overview of how to 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 …

READ FULL ARTICLE

How do I clear all SnapEngage cookies when my user logs out of my site?

About This Article

The purpose of this article is to provide a comprehensive overview of how to clear all SnapEngage cookies when my user logs out of your site.

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

SnapEngage.clearAllCookies();

Note- place your JS Api below the line of code that reads …

READ FULL ARTICLE

How do I open the chat window programmatically?

About This Article

This article explains how to programmatically open the chat window.

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.

SnapEngage.openProactiveChat();

You can …

READ FULL ARTICLE

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

About This Article

The purpose of this article is to provide a comprehensive overview of how to 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);
READ FULL ARTICLE

JavaScript event API documentation

About This Article

The purpose of this article is to provide a comprehensive overview of JavaScript events.

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


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:

READ FULL ARTICLE

How to: Google Analytics

About This Article

The purpose of this article is to provide a comprehensive overview of how to track SnapEngage events in 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 …

READ FULL ARTICLE

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

About This Article

The purpose of this article is to provide a comprehensive overview of how to pre set an email address for pre-chat forms or the start of a 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 …

READ FULL ARTICLE