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

# Google Analytics

> Google Analytics(GA) is an analytics tracking tool built by Google used by businesses to track their website traffic behaviour.

![Image](https://mintcdn.com/wotnot/ZvBlY58cOcRHCVBj/images/image-557.png?fit=max\&auto=format\&n=ZvBlY58cOcRHCVBj\&q=85\&s=95720bf277402e235370a2fcf763264e)

> [!NOTE]
>
> Available on the **STARTER plan** and above

> [!NOTE]
>
> **Web widget only:** The Google Analytics action block uses client-side tracking, so events are fired from the visitor's browser. This integration is designed for **Google Analytics 4 (GA4)**. Universal Analytics is no longer supported by Google.

# What you can do

| What you can do | What it does | Action block |
| :- | :- | :- |
| **Fire an event** | Sends a custom event to your GA4 property when the flow reaches the Google Analytics action block. | Google Analytics |
| **Add event parameters** | Sends additional information with an event, such as the option selected by a visitor or the value stored in a variable. | Google Analytics |
| **Use variables** | Dynamically populate the event name or event parameter values using variables from the conversation. | Google Analytics |

The Google Analytics block does not map chatbot fields to a Google Analytics record. Instead, it sends an event and its parameters directly to the GA4 property associated with the measurement ID.

# Before you start

Before configuring Google Analytics in WotNot, make sure you have:

* A **Google Analytics 4 property**.
* A **web data stream** configured for the website where the WotNot widget is installed.
* The **Measurement ID** for the web data stream.
* The Google Analytics tag already installed on the website hosting the WotNot widget.

The WotNot integration sends chatbot events to your existing Google Analytics setup. It does not install Google Analytics on your website or replace your existing tracking configuration.

# **Measurement ID**

The measurement ID acts as a critical link, connecting your website to the corresponding data stream in Google Analytics 4. It ensures that the data from your site is sent to the right location.

[Find your measurement ID](https://support.google.com/analytics/answer/12270356?hl=en)

# **Event name**

The name of the event that you want to fire. Event names are to be written in lowercase without spaces and help you easily understand what that event is.

Some examples are -- chat-started, menu-selected, lead-generated etc.

# Event parameters

An event parameter is an additional piece of data about a user interaction on a website and/or app, offering valuable context and details about the interaction.

| Parameter | Purpose | Can a variable populate it? |
| - | - | - |
| **Parameter name** | Identifies the information being sent with the event. | No. Define the parameter name in the Google Analytics block. |
| **Parameter value** | Contains the value associated with the parameter. | Yes. You can use a WotNot variable. |
| **Custom parameter** | Captures information specific to your chatbot or business. | Yes. The value can be static or dynamically populated with a variable. |

For example, in the below screenshot we have a main menu with multiple options. We can create an event "menu-selected" and pass an additional event parameter which tracks the menu selected under "option".

![Image](https://mintcdn.com/wotnot/ZvBlY58cOcRHCVBj/images/image-558.png?fit=max\&auto=format\&n=ZvBlY58cOcRHCVBj\&q=85\&s=11e0683a67d05e0dab8d0b8dfcd0d067)

[Learn more about event parameters](https://support.google.com/analytics/answer/13675006?hl=en)

> [!NOTE]
>
> You can use variables in the Event name, and while defining value to event parameters

# Connecting Google Analytics

Google Analytics does not require an OAuth account connection in WotNot.

Instead, you connect the chatbot flow to your GA4 property by entering the property's **Measurement ID** in the Google Analytics action block.

To configure it:

1. Open the chatbot flow where you want to track an interaction.
2. Click **+** to add an action block.
3. Select **Google Analytics**.
4. Enter your GA4 **Measurement ID**.
5. Enter the **Event name** you want to send.
6. Add event parameters if you want to send additional information.

> [!CAUTION]
>
> Make sure the Measurement ID belongs to the same GA4 web data stream used on the website where the chatbot is deployed. Using the wrong Measurement ID sends the event to a different property.

# Firing events from a flow

With our 'Google analytics' integration, you can fire events to your GA account using 2 methods:

### **Client-side tracking**

With this approach, we fire a GA event on the client-side using GA's javascript methods on the browser.

All you need to do is add a "Google Analytics" block at the point in the chatbot flow when you want to fire an event, and configure it.

![Screenshot 2026 08 27 105210](https://mintcdn.com/wotnot/79SKP2TEnpNsM0nK/images/Screenshot-2026-08-27-105210.png?fit=max\&auto=format\&n=79SKP2TEnpNsM0nK\&q=85\&s=4d1b370af92d4151e2f15d35fc8ed5c6)

### **Server-side tracking**

Specifically for non-web channels like Instagram, WhatsApp, Facebook Messenger and SMS, the above method of GA tracking does not work, as work with the principle of client-side tracking.

With server-side tracking, we fire APIs of Google analytics to record an event.

To configure this, you would need:

* **Measurement ID** - GA account in which you want to record the event.
* **API secret** - Goto Settings -> Data stream -> Measurement Protocol API secrets -> "Create" to create your API secret.

![Screenshot 2026 08 27 105613](https://mintcdn.com/wotnot/79SKP2TEnpNsM0nK/images/Screenshot-2026-08-27-105613.png?fit=max\&auto=format\&n=79SKP2TEnpNsM0nK\&q=85\&s=1c9508a18922dd3f4d2278901a5744b8)

# Testing

After configuring the Google Analytics block, test the chatbot and verify that the event reaches the correct GA4 property.

### Verify the event in Realtime

1. Open your chatbot on the website where the widget is installed.
2. Start a test conversation.
3. Navigate through the flow until it reaches the **Google Analytics** block.
4. Trigger the event.
5. Open your GA4 property.
6. Go to **Reports > Realtime**.
7. Look for the event under the event activity, such as **Event count by Event name**.

GA4's Realtime report lets you verify events shortly after they are sent.

### Verify event parameters

If the event appears but you want to confirm that its parameters are being sent correctly:

1. Open **DebugView** in GA4.
2. Trigger the event again from your test chatbot session.
3. Select the event in DebugView.
4. Review the parameters associated with the event.

DebugView is useful for verifying that events and their parameters are being sent correctly.

> **Note:** Events can take some time to appear in GA4 reports. Google states that events should appear in **DebugView within seconds** and in **Realtime reports within minutes**. Standard GA4 reports can take **24–48 hours** to fully process data.

# Using JavaScript

Overview on how to fire events on Google Analytics using the JavaScript action block.

**1. **Make sure that the Google Analytics 4 code snippet is present****

In order to fire events to your measurement ID, you need to first make sure that the Google Analytics code snippet is already added to your website. Usually, website either add it manually on the code or using Google Tag Manager.

**2. **Add the JavaScript block on the chatbot flow****

At the point in the chatbot flow when you want to fire an event, add the JavaScript action block and input this code.

```text theme={null}
window.dataLayer = window.dataLayer || [];
function gtag() {
  window.dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "YOUR-MEASUREMENT-ID");
gtag("event", "YOUR-EVENT-NAME", {
  "send_to": "YOUR-MEASUREMENT-ID"
  // ADDITIONAL PARAMETERS THAT YOU MAY WANT TO PASS
});
```

Make sure you add the MEASUREMENT ID of your GA4 property in the mentioned places. And also, use the event name as per your requirement.

You can find your MEASUREMENT ID by navigating to the Settings -> Data collection -> Data streams

![Image](https://mintcdn.com/wotnot/elfXskjw03cZp36u/images/image-774.png?fit=max\&auto=format\&n=elfXskjw03cZp36u\&q=85\&s=1009e4b3a58bb7f28287e39f97e98a31)

Refer to this page for default GA events -- [https://developers.google.com/analytics/devguides/collection/gtagjs/events](https://developers.google.com/analytics/devguides/collection/gtagjs/events)

> [!NOTE]
>
> Note that it takes about 20-30 seconds for events to reflect in Google Analytics.

# Troubleshooting

> [accordion] Events are not appearing in Google Analytics
>
> Check the following:
>
> * Confirm that the chatbot is deployed on the website associated with your GA4 web data stream.
> * Verify that the Measurement ID in the Google Analytics block is correct.
> * Make sure the Measurement ID starts with `G-`.
> * Confirm that the visitor reaches the Google Analytics action block.
> * Test the event using GA4 **Realtime** or **DebugView**.
> * Check whether an ad blocker or consent-management tool is preventing Google Analytics from running.
>
> If the website's GA4 tag is not loading, WotNot cannot send a client-side event to that Google Analytics property.

> [accordion] Events are arriving without parameters
>
> Check the parameter configuration in the Google Analytics block:
>
> * Make sure the parameter name is entered correctly.
> * Confirm that the variable used as the parameter value contains a value when the block executes.
> * Test the flow with a known value instead of a variable to determine whether the issue is with the variable.
> * Use GA4 **DebugView** to inspect the parameters received with the event.
>
> Sending a custom parameter is separate from making that parameter available in GA4 reports. Custom parameters may need to be registered as custom dimensions or metrics before you can analyze them in standard reports.

> [accordion] Custom dimensions are blank
>
> If the event is visible but a custom parameter is not available in your reports, register the parameter as a **custom dimension** in GA4.
>
> Sending the parameter from WotNot only collects the parameter. GA4 requires custom parameters to be registered before their values can be used in standard reports and explorations.
>
> Also check that:
>
> * The custom dimension uses the same parameter name sent by WotNot.
> * The correct scope is selected.
> * You are checking data collected after the custom dimension was registered.

> [accordion] Ad blockers or consent banners are preventing events
>
> The Google Analytics integration uses client-side tracking. The visitor's browser must allow the Google Analytics scripts and requests to execute.
>
> An ad blocker, privacy extension, browser setting, or consent-management banner can prevent Google Analytics from loading or prevent analytics requests from being sent.
>
> If tracking works when analytics consent is granted but not before consent is given, this is expected behavior based on the website's consent configuration rather than a WotNot flow error.
>
> Test the chatbot in a browser without an ad blocker and with the required analytics consent enabled.

> [accordion] The same event is appearing more than once
>
> Duplicate events can occur when the same tracking action is triggered more than once.
>
> Check your flow for:
>
> * Multiple Google Analytics blocks firing the same event.
> * A loop or repeated path that reaches the same Google Analytics block more than once.
> * The same event being sent separately through the Javascript block.
> * Existing website or Google Tag Manager tracking that sends the same event.
>
> Keep a single tracking implementation for each event unless you intentionally want multiple events.

> [accordion] Events are appearing in the wrong Google Analytics property
>
> This usually means the wrong Measurement ID is configured.
>
> 1. Open the Google Analytics block in WotNot.
> 2. Check the Measurement ID.
> 3. In Google Analytics, go to **Admin > Data collection and modification > Data streams**.
> 4. Open the website's web data stream.
> 5. Compare its Measurement ID with the value configured in WotNot.
> 6. Update the WotNot block if the IDs do not match.
> 7. Publish the chatbot and test again.
>
> Make sure you are viewing the same GA4 property associated with that web data stream.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.