Skip to main content

Artibot AI Chat GTM Event Listener

Track Artibot AI chatbot interactions in GTM. Monitor widget expand/collapse, chat start, messages, and chat end with artibot_action and artibot_id variables.

artibotai-chatbotchatgtmga4lead-generationsmall-business

Event fired

artibot_event

Key variable

artibot_action

Artibot AI

Overview

Artibot is an AI chatbot tool for lead generation and customer engagement. This listener hooks into Artibot's window.artibotApi interface to track 6 key interactions.

Event fired: artibot_event Variables: artibot_action, artibot_id

Tracked Events

artibot_actionDescription
widget expandedChatbot opens
widget collapsedChatbot closes
chat initiatedConversation starts
visitor message sentUser sends message
visitor message receivedBot replies
chat endedSession complete

Installation

html
<!-- GTM Custom HTML Tag: Artibot AI Listener -->
<script>
(function() {
  function artibotPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'artibot_event',
      'artibot_action': action,
      'artibot_id': window.artibotApi ? artibotApi.getBotId() : ''
    }, extra || {}));
  }

  var initArtibot = function() {
    if (typeof window.artibotApi === 'undefined') return;
    artibotApi.on('bot:ready', function() {});
    artibotApi.on('bot:expanded', function() { artibotPush('widget expanded'); });
    artibotApi.on('bot:collapsed', function() { artibotPush('widget collapsed'); });
    artibotApi.on('chat:started', function() { artibotPush('chat initiated'); });
    artibotApi.on('chat:messageSent', function() { artibotPush('visitor message sent'); });
    artibotApi.on('chat:messageReceived', function() { artibotPush('visitor message received'); });
    artibotApi.on('chat:ended', function() { artibotPush('chat ended'); });
  };

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

Data Layer Output

json
{
  "event": "artibot_event",
  "artibot_action": "chat initiated",
  "artibot_id": "bot_abc123"
}

Trigger Configuration

Trigger Type: Custom Event Event Name: artibot_event

Variables to Capture

Variable NameDL KeyExample
DLV – Artibot Actionartibot_action"chat initiated"
DLV – Artibot IDartibot_id"bot_abc123"

GA4 Mapping

GA4 EventConditionParameters
chat_widget_openartibot_action = widget expandedchat_platform: "artibot"

Related Listeners