Home > Starting a Chat from a QR Code


(Last Updated On: )

About This Article

The purpose of this article is to provide a comprehensive overview of how to open a chat from a QR Code. A QR code in the window or on a site ensures you remain open at all times. Passers-by simply scan it on their phone to immediately chat with one of your friendly live chat agents.


You can start a chat from a QR code, however, there are certain limitations. SnapEngage needs an active browser window to work — JavaScript code can not be included in QR codes for security reasons. So you’ll need to create a QR code that opens a landing page for these QR Codes.

Create your QR Code

Create a QR code here, it’s up to you to design the content.

The only requirement is that you install the SnapEngage Code Snippet on the QR code landing page.

Start the chat immediately

On this special landing page, you then add the following call to the SnapEngage code after the line: //Place your SnapEngage JS API Code below

SnapEngage.openProactiveChat(true, true);

This will open a Proactive Chat window without a delay when the page loads. (Assuming you have agents online. Otherwise this will open the Offline Form instead.)

If you would like to have a special first chat message on this page, you might consider creating a Proactive Rule for this landing page.


If you wish to make use of your Pre-Chat Form on this landing page, the above will not do that.

In this case, do not use the .openProactiveChat() function above. Use the following instead:


Optional addition

Since this page’s primary purpose is to receive visitors from these email links, it is likely that there won’t be a lot of useful content on the page.

So you can also add a callback that will close the special landing page once the chat window is closed.

You would then add the following code (Beneath your openProactiveChat or startLink call):

SnapEngage.setCallback('Close', function(type, status) {
// Code to call when the chat window is closed
document.location = '/';
// URL you send the visitor to, '/' is the home directory

You can modify the line document.location = '/'; if you’d like to send your visitor to a specific page.

For additional information on what this code is doing, feel free to check out our Javascript Events Documentation on our Developer API knowledgebase.

Did you find this article helpful?

Not HelpfulNeeds WorkSo-soHelpfulVery Helpful (No Ratings Yet)
Loading ... Loading ...

Published August 25, 2021