Track Intercom Chats

Intercom is a customer messaging platform that provides live chat, chatbots, help desk, and customer engagement tools. WhatConverts can track Intercom chat conversations through a Zapier integration combined with custom JavaScript code, which captures closed conversations along with complete marketing attribution, including source, medium, campaign, landing page, and click ID information.

Note: If you haven't added your WhatConverts tracking script 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 Intercom Integration Code.

Set Up Intercom Chat Tracking

To track Intercom chat conversations with WhatConverts, you'll need to replace your standard Intercom code with custom tracking code and configure a Zapier automation.

Step 1: Replace Intercom Installation Code

  1. On your website, where you have placed your Intercom JavaScript Installation Code, replace your Intercom Basic JavaScript for Website Visitors Installation Code with the code below.

    javascript

    <script>
    var cookie = oqhaqzwnbjgcpycneryg('wc_client');
    var source = '',
        medium = '',
        campaign = '',
        content = '',
        keyword = '',
        gclid = '',
        landing_page = '',
        user_id = '',
        msclkid = '';
    if (cookie) {
        var cookie_parts = cookie.split('+..+');
        if (cookie_parts[0])
            source = cookie_parts[0];
        if (cookie_parts[1])
            medium = cookie_parts[1];
        if (cookie_parts[2])
            campaign = cookie_parts[2];
        if (cookie_parts[3])
            content = cookie_parts[3];
        if (cookie_parts[4])
            keyword = cookie_parts[4];
        if (cookie_parts[5])
            gclid = cookie_parts[5];
        if (cookie_parts[6])
            landing_page = cookie_parts[6];
        if (cookie_parts[7])
            user_id = cookie_parts[7];
        if (cookie_parts[8])
            msclkid = cookie_parts[8];
    }
    window.intercomSettings = {
        app_id: "********",
        source: source,
        medium: medium,
        campaign: campaign,
        content: content,
        keyword: keyword,
        gclid: gclid,
        landing_page: landing_page,
        user_id: user_id,
        msclkid: msclkid
    };
    </script>
    <script>
    (function() {
        var w = window;
        var ic = w.Intercom;
        if (typeof ic === "function") {
            ic('reattach_activator');
            ic('update', w.intercomSettings);
        } else {
            var d = document;
            var i = function() {
                i.c(arguments);
            };
            i.q = [];
            i.c = function(args) {
                i.q.push(args);
            };
            w.Intercom = i;
            var l = function() {
                var s = d.createElement('script');
                s.type = 'text/javascript';
                s.async = true;
                s.src = 'https://widget.intercom.io/widget/*******';
                var x = d.getElementsByTagName('script')[0];
                x.parentNode.insertBefore(s, x);
            };
            if (w.attachEvent) {
                w.attachEvent('onload', l);
            } else {
                w.addEventListener('load', l, false);
            }
        }
    })();
    </script>
    
  2. Note: Replace ******* with your Intercom App ID. You can find your App ID inside your Intercom JavaScript Installation Code.

    Track Intercom Chats

  3. Save your changes.

Step 2: Set Up Zapier Integration

  1. Go to Zapier and click "Create Zap".
  2. Select "Intercom" as your Trigger App and "New Closed Conversation" as the Trigger Event.
  3. Test your Trigger step on your website by starting and ending a chat. Click "Test Trigger" to pull in sample chats.
  4. Review the most recent chat and make sure you're using the most recent chat with WhatConverts data appended. Click "Continue".
  5. Select "Intercom" as your first Action App and select "Find Lead" as the Action Event. Click "Continue".
  6. Under Search Mode, select "ID" and under Search Value, select "User ID". Click "Continue". Test your step and, once successful, click "Finish".
  7. Track Intercom Chats

  8. Add a third Action Step and select "WhatConverts" as your Action App. Select "Create Lead" as the Action Event, then click "Continue".
  9. Select your WhatConverts account to integrate with Intercom.
  10. Set up your template as follows:
    • Lead Type: Chat
    • Profile: Your WhatConverts Profile
    • Referrer Source: Utm Source
    • Referrer Medium: Utm Medium
    • Referrer Campaign: Utm Campaign
    • Referrer Content: Utm Content
    • Referrer Keyword: Utm Term
    • Gclid: Custom Attributes Gclid
    • User ID: Custom Attributes User ID
  11. Track Intercom Chats

  12. Add the following fields under Additional Fields:
    • Transcript: Messages Body
    • Email: User Email
    • Name: User Name
    • Transcript URL: Links Conversation Web
  13. Click "Continue" and send a test to WhatConverts. When the test is successful, you can name your Zap and turn your Zap "on".

Your Intercom integration is now complete. WhatConverts will capture all closed chat conversations from Intercom through Zapier and create leads with full attribution data.

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

Related Topics

Get a FREE presentation of WhatConverts

One of our marketing experts will give you a full presentation of how WhatConverts can help you grow your business.

Schedule a Demo
ready to get marketing clarity?

Grow your business with WhatConverts

14 days free trial Easy setup Dedicated support
G2 Best Results Summer 2025 Badge
G2 Best Relationship Summer 2025 Badge
G2 Best Usability Summer 2025 Badge
G2 Most Implementable Summer 2025 Badge
G2 Momentum Leader Summer 2025 Badge