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_eventKey variable
artibot_actionArtibot 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_action | Description |
|---|---|
widget expanded | Chatbot opens |
widget collapsed | Chatbot closes |
chat initiated | Conversation starts |
visitor message sent | User sends message |
visitor message received | Bot replies |
chat ended | Session 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 Name | DL Key | Example |
|---|---|---|
| DLV – Artibot Action | artibot_action | "chat initiated" |
| DLV – Artibot ID | artibot_id | "bot_abc123" |
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
chat_widget_open | artibot_action = widget expanded | chat_platform: "artibot" |