# Google Analytics

{% hint style="info" %}
Available on the **STARTER plan** and above
{% endhint %}

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

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.&#x20;

<figure><img src="/files/8fAjeN2nr05i7OQWrZN0" alt=""><figcaption></figcaption></figure>

To configure a GA action block, you need to add the following details:

### 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

&#x20;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.&#x20;

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

### Event parameter

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.

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".

<figure><img src="/files/fxX9yTE4q2xVvgMstUq0" alt=""><figcaption></figcaption></figure>

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

{% hint style="info" %}
You can use variables in the Event name, and while defining value to event parameters
{% endhint %}

## 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.&#x20;

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.

<figure><img src="/files/jB8h7OBg22k5sUjTw8WX" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.wotnot.io/build/integrations/native/google-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
