The chat widget automatically sends events when visitors interact with it. You can use these events in Google Tag Manager (GTM) to track chats in Google Analytics 4 (GA4) or count them as Google Ads conversions, with no click triggers or CSS selectors needed.
Events the widget sends
Event name | When it fires |
| A visitor starts a chat: clicks the chat button (when it opens the chat app directly), clicks a person in the popup, or clicks Start Chat |
| The chat popup opens |
| The chat popup closes |
Each event includes these details:
Parameter | Example | Notes |
|
| Always the same |
|
| The page the visitor was on |
|
|
|
|
|
|
|
| Position of the person in the popup, starting at 0 |
|
|
|
Tip: Mark chat_click as your conversion. It's the event that means a visitor actually started a chat.
Set up Google Tag Manager
Before you start, make sure your GTM container is installed on your site.
Step 1: Create the trigger
In Google Tag Manager, go to Triggers → New.
Choose Custom Event.
In Event name, enter
chat_click.To track all three events with one trigger, enter
^chat_(click|popup_open|popup_close)$instead and check Use regex matching.
Name the trigger (for example, Chat button – click) and click Save.
Step 2 (optional): Create variables for the event details
Do this if you want to see which person or button was clicked in your reports.
Go to Variables → User-Defined Variables → New.
Choose Data Layer Variable.
In Data Layer Variable Name, enter
person_name. Save it as DLV – person_name.Repeat for
sourceandlink_url.
Step 3: Send the event to Google Analytics 4
Go to Tags → New.
Choose Google Analytics → Google Analytics: GA4 Event.
In Measurement ID, enter your GA4 ID (it starts with
G-).In Event Name, enter
{{Event}}. This passes the widget's event name through to GA4.(Optional) Under Event Parameters, add:
person_name→{{DLV – person_name}}source→{{DLV – source}}link_url→{{DLV – link_url}}
Under Triggering, select the trigger from Step 1.
Click Save.
Step 4 (optional): Count chats as Google Ads conversions
Go to Tags → New → Google Ads Conversion Tracking.
Enter your Conversion ID and Conversion Label from Google Ads.
Under Triggering, select a trigger for
chat_clickonly. Don't use the regex trigger here, or opening and closing the popup will also count as conversions.Click Save.
Step 5: Publish
Click Submit → Publish in Google Tag Manager. Changes don't go live until the container is published.
Test your setup
In Google Tag Manager, click Preview and enter your site's URL.
On your site, open the chat widget and click Start Chat.
Go back to Tag Assistant. You should see
chat_popup_openandchat_clickin the event list on the left.Click
chat_click. Your GA4 tag should be listed under Tags Fired.In GA4, open Admin → DebugView to see the event arrive within a few seconds.
To use person_name and source in GA4 reports, register them under Admin → Custom definitions → Create custom dimension (scope: Event).
Note: New events can take 24–48 hours to appear in standard GA4 reports. Use DebugView or Realtime to confirm right away.
Troubleshooting
The events don't appear in Tag Assistant. Do a hard refresh of your site (Ctrl+Shift+R on Windows, Cmd+Shift+R on Mac) to make sure your browser has the latest version of the widget. Also try a private window with ad blockers turned off.
The events appear in Tag Assistant, but no tag fires. Check that the trigger's event name exactly matches chat_click (or that Use regex matching is checked if you used ^chat_(click|popup_open|popup_close)$), and that the container is published.
The tag fires, but nothing shows in GA4. Check that the Measurement ID in the tag matches your GA4 property. If your site has a cookie consent banner, accept it during testing. Google tags may not send data until the visitor gives consent.
I set up a click trigger with this article's previous instructions. That setup tracked clicks on the text "Start Chat", so it stops working if you change the button text or use a different language. It also doesn't track clicks on the main chat button. We recommend switching to the chat_click trigger above, then pausing or deleting the old click trigger so chats aren't counted twice.
Need help? Contact us and we'll be happy to help with your setup.
