Skip to main content

HelpScout Beacon GTM Event Listener

Track HelpScout Beacon chat and knowledge base interactions in GTM. Monitor open/close, messages, search queries, article views, and email captures with chatBeaconId and chatAction.

helpscoutbeaconchatknowledge-basegtmga4supportsaas

Event fired

Helpscout_Interaction

Key variable

chatBeaconId

HelpScout (Beacon)

Overview

HelpScout's Beacon widget combines live chat, a help center knowledge base, and a contact form. This listener hooks into Beacon's JavaScript API to track opens, closes, message sends, article views, knowledge base searches, and email captures.

Event fired: Helpscout_Interaction Variables: chatBeaconId, chatAction

Common Use Cases

  • Track support deflection (article views vs. messages)
  • Measure knowledge base search effectiveness
  • Build GA4 segments of users who needed support
  • Fire lead events on email capture

Tracked Events

chatActionDescription
beacon openedBeacon widget opens
beacon closedBeacon closes
message sentUser sends chat message
email capturedEmail submitted via Beacon
article viewedKnowledge base article opened
search performedUser searched the help center
suggest shownArticle suggestions displayed
suggest article clickedSuggestion article clicked

Installation

html
<!-- GTM Custom HTML Tag: HelpScout Beacon Listener -->
<script>
(function() {
  function beaconPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'Helpscout_Interaction',
      'chatAction': action,
      'chatBeaconId': window.Beacon ? '' : '' // Beacon ID from init
    }, extra || {}));
  }

  var initBeacon = function() {
    if (typeof window.Beacon === 'undefined') return;
    Beacon('on', 'open', function() { beaconPush('beacon opened'); });
    Beacon('on', 'close', function() { beaconPush('beacon closed'); });
    Beacon('on', 'email-submitted', function(data) {
      beaconPush('email captured', { visitorEmail: data.email });
    });
    Beacon('on', 'message', function() { beaconPush('message sent'); });
    Beacon('on', 'article-viewed', function(data) {
      beaconPush('article viewed', {
        articleId: data.id,
        articleTitle: data.text
      });
    });
    Beacon('on', 'search', function(data) {
      beaconPush('search performed', { searchQuery: data.query });
    });
    Beacon('on', 'suggest', function() { beaconPush('suggest shown'); });
    Beacon('on', 'suggest-article-clicked', function(data) {
      beaconPush('suggest article clicked', { articleId: data.id });
    });
  };

  window.addEventListener('load', initBeacon);
})();
</script>

Data Layer Output

Article Viewed

json
{
  "event": "Helpscout_Interaction",
  "chatAction": "article viewed",
  "articleId": "article_123",
  "articleTitle": "How to reset your password"
}

Search Performed

json
{
  "event": "Helpscout_Interaction",
  "chatAction": "search performed",
  "searchQuery": "billing issue"
}

Trigger Configuration

Trigger: Custom Event | Helpscout_Interaction

Per action:

Condition: DLV – HC Action | equals | message sent

Variables to Capture

Variable NameDL KeyExample
DLV – HS ActionchatAction"message sent"
DLV – HS Article IDarticleId"article_123"
DLV – HS Search QuerysearchQuery"billing issue"

GA4 Mapping

GA4 EventConditionParameters
chat_widget_openbeacon openedchat_platform: "helpscout"
searchsearch performedsearch_term
view_itemarticle vieweditem_name (article title)

Best Practices

  1. Track search performed vs. message sent ratio, high search rate with low message rate means your docs are working
  2. Use articleId to identify which knowledge base articles prevent support tickets
  3. Track email captured for lead generation from Beacon contact forms

Related Listeners