Skip to main content
Whenever a visitor performs an action inside the widget, an event is triggered. These events are sent directly from the widget and can be listened to by any tool running on your website. Examples of actions that trigger events include:
  • Opening, loading and closing the widget.
  • Sending, receiving messages for both the AI Agent, end user and Human Agent.
  • Outbound Clicks.
No configuration is needed—the chatbot automatically sends events to the data layer.

Available events

Tracking Events in GA4 from the Widget with Google Tag Manager

1

Install the widget

Install the website widget code using this guide
2

Go to Google Tag Manager

Log in to Google Tag Manager.
3

Check that events reach the dataLayer

The widget pushes events into the browser’s dataLayer.To verify this:
  1. Open your website with GTM Preview Mode enabled.
    Prevew Url Entry Pn
  2. Interact with the widget (fire an event).
  3. In the left panel, you should see event names appear under the “Events” section.
If you see them, you’re ready to track them.
4

Create a GTM Trigger for a Widget Event

You can set up triggers in two ways, depending on your tracking needs:Option 1: Individual Triggers (One trigger per Event).
  1. In GTM, go to Triggers → New.
  2. Choose Custom Event.
  3. Enter the event name, for example: widget_conversation_started.
  4. Set This trigger fires on: All Custom Events.
  5. Save.
**Option 2: **RegEx Trigger (Catch multiple Events in one trigger).
  1. In GTM, go to Triggers → New.
  2. Choose Custom Event.
  3. Select Use regex matching.
  4. Enter a pattern to match multiple events:
    1. ^widget_.* catches all widget events;
    2. ^widget_.*_clicked$ catches all click events only;
    3. ^widget_(opened|closed|loaded)$ catches specific event groups.
  5. Set This trigger fires on: All Custom Events.
  6. Save.
5

Create a GA4 Event Tag

To send the captured widget event to Google Analytics:
  1. Go to TagsNew.
  2. Choose Google Analytics: GA4 Event.
  3. Select your GA4 Configuration Tag.
  4. Under Event Name, use the same event name from the widget, for example:
6

Connect events

Attach the Custom Event Trigger you created earlier and click save.
7

Verify events

After publishing, test your events using DebugView:
  1. Go to GA4 → Admin (gear icon, bottom left) → Data Display → DebugView;
  2. Trigger widget events on your site, using PreviewMode in GTM;
  3. Events should appear as blue hits in real-time.
Gtm Debug View Pn
The page_view is a normal hit, while the chat_widget_.* events are Key Events

Create Key Events (optional)

  1. Go to GA4AdminData DisplayEvents
  2. Click Create Key Event
Gtm Key Event Setup Pn
  1. Add the widget event, with the exact event name, to convert it from a regular hit (blue ball) to a key event (green ball) in DebugView.
Events will also appear under ReportsEngagementEvents over time.

Use events across multiple platforms

The widget events aren’t limited to GA4. The Custom Event triggers, made in point 5 can be used to fire all other conversion and event tags:
  1. Google ads
Gtm Fb Pn
  1. Facebook ads
Gtm Fb Pn
  1. LinkedIn ads
Gtm Ga4 Pn
  1. Any other tag-based platform
This allows you to track widget interactions as conversions across your entire marketing stack from a single implementation.

How to use the Event Parameters

Each Widget Event has dedicated, built in Event Parameters, add them  to all you analytics platform tags, like GA4, Matomo or HubSpot.
Gtm Event Paramaters Pn
Conversion based tags (E.g. Google Ads, LinkedIn Ads, Microsoft UET Ads) do not benefit nor optimize using this information.
Before you can add them to your tags, you have to make the datalayer Variables:
  • In GTM, go to Variables → New.
  • ChooseData Layer Variable .
  • Enter the datalayer variable name, for example: widget_id.
    • Find these in the datalayer → same as event testing in GTM preview:
      Gtm Preview Ep Pn
    • It should look like this:
      Gtm Example Vc Pn
    • Save.
    • Make all the other variables you need to measure, for example:
      Gtm Example Ep Pn
    • Add the individual Datalayer Variables to your Analytics tag, for example GA4:
      Gtm Analytics Tag Pn