Connect your Gladly Team Chat widget to Google Analytics to see how Customers interact with your support experience. This integration automatically tracks events like when someone opens Chat, sends a message, or completes a Conversation, giving you insights to improve your service service, as well as attribute sales revenue to Gladly AI.
If you are not using Google Analytics, you can still track your data by setting this up manually
What you can track
Once enabled, the Chat widget automatically sends events to your Google Analytics account. You'll be able to see:
When customers open or close the chat widget
Messages sent and received
Conversation starts and ends
Quick action button clicks
Search result selections
Proactive campaign triggers
Agent availability changes
All events are prefixed with gladly_ so you can easily filter them in your analytics reports.
Setting up Google Analytics tracking
Enable tracking in Gladly
Click
on the top left corner of the screen.
Click Settings.
Under the Channels category, click Chat. The Chat page will show you a list of Chats you currently have. Select the widget you want to track
Click
, then select Configure.
Find the Google Analytics tracking section
Check the box next to Enable Google Analytics Tracking.

Auto-detect Tracking ID (recommended): Gladly automatically finds your GA4 or Google Tag Manager setup on your website.
If you uncheck the box next to Auto-detect Tracking ID (recommended), you’ll be able to enter the GA4 tracking id:
Custom GA4 Tracking ID: Enter your GA4 Measurement ID manually (looks like
G-XXXXXXXXXX)
Click Save
Your updates will go live within five minutes.
Complete your analytics setup
What you do next depends on how your website uses Google Analytics.
If you use GA4 directly (gtag.js) – You're all set! Events will automatically appear in your GA4 property.
If you use Google Tag Manager – You'll need to configure GTM to send events to GA4. See the detailed instructions below.
Configuring Google Tag Manager
When using GTM, events are sent to your dataLayer but won't appear in GA4 until you create a trigger and tag to forward them.
Create a trigger for Gladly events
In GTM, go to Triggers → New.
Select Custom Event as the trigger type.
Set the event name to:
gladly_*(this captures all Gladly events).Choose All Custom Events that match the pattern.
Name it something clear like "Gladly Chat Events."
Click Save.
Create a GA4 tag
Go to Tags → New.
Select Google Analytics: GA4 Event.
Enter your GA4 Measurement ID.
Set the Event Name to:
{{Event}}.Add event parameters by creating Data Layer Variables for the parameters you want to capture (like
event_category,source,text).Under Triggering, select the Gladly trigger you just created.
Name the tag (like "GA4 - Gladly Chat Events").
Click Save.
Test and publish
Click Preview in GTM to enter debug mode.
Open your website and interact with your chat widget.
Confirm that Gladly events appear in the GTM debugger and fire your GA4 tag.
Once verified, click Submit and Publish.
Verifying your setup
Check events in real-time
Open your GA4 property and go to Reports → Realtime → Event count by Event name. Look for events starting with gladly_.
Use browser developer tools
Open DevTools (press F12).
Go to the Network tab.
Filter by
analytics.google.com/g/collect.Interact with your chat widget.
You should see network requests containing your Gladly events.
Use Google Tag Assistant
Install the Tag Assistant Chrome extension to see all events firing in real-time and verify parameters are captured correctly.
Events reference
Event name | What it tracks |
|---|---|
| Customer opens the chat widget |
| Customer closes the Chat widget |
| Customer sends a message |
| Message received from Agent or automation |
| New conversation begins |
| Conversation closes |
| Customer completes pre-chat form |
| Customer clicks a quick action button |
| Customer selects a search result |
| Proactive campaign fires |
| Agent availability status changes |
Each event includes relevant details like message type, how the widget was opened, or which quick action was selected. For a complete list of properties associated with each event, see the Chat SDK developer documentation.
Good to know
Auto-detect works best for most setups. Only use a custom tracking ID if you need to send events to a specific GA4 property that differs from what's on your page.
Custom tracking IDs only work with GA4, not Google Tag Manager. If you use GTM, stick with auto-detect.
Changes take up to 5 minutes to go live after you save your settings.
Customer data is included in some events. The
gladly_customer_onboardedevent captures the name and email customers enter in pre-chat forms. Make sure this aligns with your privacy policies.
FAQ
Events aren't showing up at all
Confirm tracking is activated in your Gladly Team Chat settings. Check that your GA4 or GTM code is loading on the page before the chat widget
Events appear in GTM but not GA4
Verify your GTM trigger matches
gladly_*Confirm your GA4 tag is using the correct Measurement ID
Make sure you've published your GTM container after making changes
Events show in DevTools but not GA4 realtime
Realtime reports can have a slight delay. Wait a minute and refresh. You can also verify the Measurement ID in your requests matches your GA4 property.