DocuChat Logo
Analytics

Google Tag Manager

Learn how to set up Google Tag Manager (GTM) for your DocuChat chatbots.

Google Tag Manager (GTM) integration allows you to track user interactions with your DocuChat chatbots. This enables you to gather valuable analytics data and understand how users engage with your chatbot.

If you input a GTM code and enable tracking, you are responsible for ensuring data protection and privacy compliance, including notice and consent requirements.

Setup

  1. Create or open your Google Tag Manager account
  2. Locate your GTM Container ID (format: GTM-XXXXXX)
  3. Sign in to DocuChat as a SuperAdmin
  4. Navigate to Settings > Organization Settings
  5. Enter your GTM Container ID in the tracking settings section

Available Events

DocuChat automatically pushes the following events to the GTM data layer:

Event NameDescription
chat_initializedTriggered when the chat interface loads
question_askedTriggered when a user submits a question
answer_receivedTriggered when the chatbot provides an answer
chat_restartedTriggered when the chat session is restarted
cta_clickedTriggered when a user clicks the call-to-action button
chat_window_resizedTriggered when the chat widget is maximized/minimized (widget embeds only)

Implementation Guide

  1. Create Triggers in GTM
    • Go to your GTM workspace
    • Create new triggers for each event you want to track
    • Use "Custom Event" as trigger type
    • Enter the exact event name (e.g., chat_initialized)
  2. Set Up Tags
    • Create tags for your analytics platform (e.g., Google Analytics 4)
    • Associate the tags with the triggers you created
    • Configure the tag parameters according to your analytics needs
  3. Testing
    • Use GTM's Preview mode to verify that events are being captured
    • Interact with your chatbot and confirm events appear in the preview panel
    • Publish your GTM container once testing is successful