1. Home
  2. Docs
  3. Integrations
  4. SnapEngage Chat Integration

SnapEngage Chat Integration

SnapEngage is a live chat software that is designed to allow your sales and support teams to interact with customers.

    Note: If you haven’t added your WhatConverts tracking code to your website, add your tracking script. If you are using the WhatConverts WordPress Plugin, you will want to deactivate the plugin and place your WhatConverts Tracking Code above your SnapEngage Install Code.

1Where your SnapEngage Chat Widget is installed on your page, add the following code directly above your installation code:

<script type="text/javascript">
var source_data = oqhaqzwnbjgcpycneryg('wc_client');

2Log into SnapEngage. Under Current Widget select “Settings“.

Current Widget Settings - SnapEngage Chat Tracking

Select “Options” at the top of the Settings Menu. Beside Collect additional information add the following JavaScript Variable: source_data

SnapEngage Chat Tracking - Source Data

Click “Save Changes“.

3Go to Zapier and click “Make a Zap“. Search for and select “Webhooks by Zapier as your Trigger App. Click “Continue“. Select “Catch Hook as your Trigger and click “Continue“. Copy the webhook URL to your clipboard.

4Go back to SnapEngage. In the Settings Menu select “Integrations“. Paste the webhooks URL from Zapier in Integration URL box and click “Save Changes“.

SnapEngage Chat Tracking - Integration Webhook URL

5Go to your page SnapEngage is installed on and start (and end) a chat session.

6Return to the Zapier setup, click “Ok, I did this“. Select one of the “Hooks” Zapier has pulled as a sample.

    Note: You can select the grey down arrow to view the data from your chat. Make sure it’s the chat you started after completing the previous steps.

Click “Continue“.

7Click “+ Add a Step“. Select “Code by Zapier” as your Action App and “Run JavaScript” as your Action.

Under Input Data type “source_data” and select the “Javascript Variables” from Step 1 – Catch Hook.

SnapEngage Chat Tracking - Edit Javascript Variables

Under Code, paste the following:

var [source,medium,campaign,content,keyword,gclid,landing_page,msclkid] = ['','','','','','','',''];
var data = inputData.source_data.match(/name: source_data\nvalue: (.*)/);
if (data[1]) {
    var data_parts = data[1].split('+..+');
    if (data_parts[0])
        source = data_parts[0];
    if (data_parts[1])
        medium = data_parts[1];
    if (data_parts[2])
        campaign = data_parts[2];
    if (data_parts[3])
        content = data_parts[3];
    if (data_parts[4])
        keyword = data_parts[4];
    if (data_parts[5])
        gclid = data_parts[5];
    if (data_parts[6])
        landing_page = data_parts[6];
    if (data_parts[8])
        msclkid = data_parts[8];
output = [{source: source, medium: medium, campaign: campaign, content: content, keyword: keyword, gclid: gclid, landing_page: landing_page, msclkid: msclkid}];

Click “Continue“. Run a test and click “Continue“.

8Click “+ Add a Step“. Select “WhatConverts” as your Action App and “Create Lead” as your Action. Select your WhatConverts account to integrate with SnapEngage.

    Note: If you have not set up a WhatConverts account in Zapier, you can follow the detailed instructions in Connecting to Zapier.

Set up your Template as follows:

    Lead Type: Chat
    Profile: Your WhatConverts Profile
    Referrer Source: Step 2 – Source
    Referrer Medium: Step 2 – Medium
    Referrer Campaign: Step 2 – Campaign
    Referrer Content: Step 2 – Content
    Referrer Keyword: Step 2 – Keyword
    Gclid: Step 2 – Gclid
    Msclkid: Step 2 – Msclkid

Add the following field under Additional Fields:

    Transcript: Step 1 – Transcripts
    Email: Step 1 – Requester Details Emails
    Name: Step 1 – Requester Details Name
    Chat URL: Step 1 – URL

SnapEngage Chat Tracking - Set Up WhatConverts Lead
Click “Continue” and send a test to WhatConverts. When the test is successful, you can name your Zap and turn your Zap “on“.