---
title: "Track Chat Interactions and Sales Attribution with Google Analytics"
slug: "track-chat-interactions-and-sales-attribution-with-google-analytics"
description: "Connect your Gladly Team Chat widget to Google Analytics for insights on customer interactions, tracking events to enhance your support experience."
updated: 2026-02-03T21:44:15Z
published: 2026-02-03T21:44:15Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.gladly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Track Chat Interactions and Sales Attribution with Google Analytics

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](https://github.com/gladly/gladapp-examples/tree/master/docs/working-with-events) 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**

1. Click ![](https://cdn.us.document360.io/7047b671-c4f2-4df0-bb0a-b9b511fd2452/Images/Documentation/hamburger-menu-icon(2).svg?sv=2022-11-02&amp;spr=https&amp;st=2026-02-03T21%3A23%3A08Z&amp;se=2026-02-03T21%3A52%3A08Z&amp;sr=c&amp;sp=r&amp;sig=tudE93xe7y%2FLQ3dAlGfLaujhFypBAGcV0BmQvsQEjfc%3D) on the top left corner of the screen.
2. Click **Settings**.
3. 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
4. Click![](https://cdn.us.document360.io/7047b671-c4f2-4df0-bb0a-b9b511fd2452/Images/Documentation/kebab-icon-vertical.svg), then select **Configure**.
5. Find the **Google Analytics tracking** section
6. Check the box next to **Enable Google Analytics Tracking.** ![Configuration settings for Google Analytics tracking in chat for sales attribution.](https://cdn.us.document360.io/7047b671-c4f2-4df0-bb0a-b9b511fd2452/Images/Documentation/google analytics configuration in chat.png)
  - **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`)
7. 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**

1. In GTM, go to **Triggers** → **New.**
2. Select **Custom Event** as the trigger type.
3. Set the event name to: `gladly_*` (this captures all Gladly events).
4. Choose **All Custom Events** that match the pattern.
5. Name it something clear like "Gladly Chat Events."
6. Click **Save.**

### **Create a GA4 tag**

1. Go to **Tags** → **New.**
2. Select **Google Analytics: GA4 Event.**
3. Enter your GA4 Measurement ID.
4. Set the Event Name to: `{{Event}}.`
5. Add event parameters by creating Data Layer Variables for the parameters you want to capture (like `event_category`, `source`, `text`).
6. Under **Triggering**, select the Gladly trigger you just created.
7. Name the tag (like "GA4 - Gladly Chat Events").
8. Click **Save.**

### **Test and publish**

1. Click **Preview** in GTM to enter debug mode.
2. Open your website and interact with your chat widget.
3. Confirm that Gladly events appear in the GTM debugger and fire your GA4 tag.
4. 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**

1. Open DevTools (press F12).
2. Go to the **Network** tab.
3. Filter by `analytics.google.com/g/collect.`
4. Interact with your chat widget.
5. You should see network requests containing your Gladly events.

### **Use Google Tag Assistant**

Install the [Tag Assistant Chrome extension](https://chromewebstore.google.com/detail/tag-assistant/kejbdjndbnbjgmefkgdddjlbokphdefk) to see all events firing in real-time and verify parameters are captured correctly.

## **Events reference**

| Event name | What it tracks |
| --- | --- |
| `gladly_sidekick_opened` | Customer opens the chat widget |
| `gladly_sidekick_closed` | Customer closes the Chat widget |
| `gladly_message_sent` | Customer sends a message |
| `gladly_message_received` | Message received from Agent or automation |
| `gladly_conversation_started` | New conversation begins |
| `gladly_conversation_ended` | Conversation closes |
| `gladly_customer_onboarded` | Customer completes pre-chat form |
| `gladly_quick_action_selected` | Customer clicks a quick action button |
| `gladly_search_result_selected` | Customer selects a search result |
| `gladly_campaign_triggered` | Proactive campaign fires |
| `gladly_availability_change` | 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](https://developer.gladly.com/chat/Gladly.html#event:availability:change).

## **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_onboarded` event 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.

## **Related resources**

- [Google's guide to GA4 event tracking](https://support.google.com/analytics/answer/9322688)
- [GTM custom event triggers documentation](https://support.google.com/tagmanager/answer/7679219)
