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

# Google Analytics (GA4)

Track chatbot interactions and conversions in Google Analytics 4 by connecting your GA4 Measurement ID

## Setting up Google Analytics tracking

<Steps>
  <Step title="Navigate to Goal Settings">
    Open your **Agent**, then go to **Configure** → **Goal Settings**.

    You'll find the **Third Party Analytics** section at the bottom of the page.
  </Step>

  <Step title="Add your GA4 Measurement ID">
    Under **Third Party Analytics**, expand the **Google Analytics** section.

    You'll see two fields:

    * **GA4 Code** — Enter your GA4 Measurement ID here (e.g., `G-1234567890`)
    * **Event** — Choose how chatbot interactions are sent to GA

    <Frame>
      <img src="https://mintcdn.com/tars-c52ebe98/g219BcGYS6hmjcSW/images/core-platform/configure/goal-settings/third-party-analytics/step_2_ga4_code_field.jpg?fit=max&auto=format&n=g219BcGYS6hmjcSW&q=85&s=521ac735f33030b6335c3751def010b1" alt="Google Analytics section expanded showing the GA4 Code input field and Event dropdown" width="1842" height="898" data-path="images/core-platform/configure/goal-settings/third-party-analytics/step_2_ga4_code_field.jpg" />
    </Frame>

    <Note>
      Your GA4 Measurement ID starts with **G-** followed by a string of numbers. You can find it in your Google Analytics account under **Admin** → **Data Streams** → **Web stream details**.
    </Note>
  </Step>

  <Step title="Select the event type">
    Open the **Event** dropdown and choose one of the following options:

    **Send no events to GA** — No chatbot events will be sent to Google Analytics. Use this if you only want to track page-level analytics without individual chatbot interaction events.

    **Send all user responses as events to GA** — Every user response in the chatbot will be sent to Google Analytics as an event. This is useful if you want to track all chatbot interactions and engagement data, giving you full visibility into how users interact with your Agent.

    **Send only Goal Gambit user responses as events to GA** — Only responses related to Goal Gambits will be sent as events to Google Analytics. This is useful when you want to track conversion-related chatbot interactions without the noise of every single message.

    <Frame>
      <img src="https://mintcdn.com/tars-c52ebe98/g219BcGYS6hmjcSW/images/core-platform/configure/goal-settings/third-party-analytics/step_3_event_type_dropdown.jpg?fit=max&auto=format&n=g219BcGYS6hmjcSW&q=85&s=db1e4adea3186f7990256b8a08565163" alt="Event dropdown showing the three tracking options: no events, all responses, and goal gambit responses only" width="1259" height="421" data-path="images/core-platform/configure/goal-settings/third-party-analytics/step_3_event_type_dropdown.jpg" />
    </Frame>
  </Step>

  <Step title="Save changes">
    Once you've added your GA4 Measurement ID and selected your event tracking preference, click **Save Changes** in the top right corner.

    Your chatbot will now start sending events to **Google Analytics 4**.
  </Step>
</Steps>

***

## Verifying your setup

After saving, you can confirm the integration is working by checking the **Realtime overview** in Google Analytics.

1. Open your Google Analytics account where you are tracking this Tars bot.
2. Go to the **Realtime overview** page.
3. Open your chatbot in another tab and interact with it — you should see a live user appear.

<Frame>
  <img src="https://mintcdn.com/tars-c52ebe98/g219BcGYS6hmjcSW/images/core-platform/configure/goal-settings/third-party-analytics/step_5_realtime_overview.jpg?fit=max&auto=format&n=g219BcGYS6hmjcSW&q=85&s=23b191e08869369a836c536aac7644fb" alt="Google Analytics Realtime Overview showing a live user on the chatbot" width="1918" height="752" data-path="images/core-platform/configure/goal-settings/third-party-analytics/step_5_realtime_overview.jpg" />
</Frame>

<Check>
  If you see a live user on your bot link in Realtime, your Google Analytics code is working correctly.
</Check>

***

## Viewing Agent's data in Google Analytics

To see detailed Agent's activity across a specific time period:

### Viewing conversation sessions

1. In Google Analytics, go to **Reports** → **Engagement** → **Pages and Screens**.
2. Copy your Agent's ID from its URL — it's the last string of characters after the final `/` (e.g., `XFgTCI`).
3. Search for that ID in the search box to filter results to just your chatbot's activity.

<Frame>
  <img src="https://mintcdn.com/tars-c52ebe98/g219BcGYS6hmjcSW/images/core-platform/configure/goal-settings/third-party-analytics/step_6_pages_and_screens.jpg?fit=max&auto=format&n=g219BcGYS6hmjcSW&q=85&s=ff50ec95842c16b6d17e489e4d641d9b" alt="Google Analytics Pages and Screens report filtered by chatbot ID showing session activity" width="1846" height="810" data-path="images/core-platform/configure/goal-settings/third-party-analytics/step_6_pages_and_screens.jpg" />
</Frame>

### Viewing stored events

On every action in your Agent (meaning chat messages exchanged between the bot and user), Tars sends a Google Analytics event with the following parameters:

* **Action** — Represents the Gambit name.
* **Label** — Represents the user's response to that particular Gambit.

<Frame>
  <img src="https://mintcdn.com/tars-c52ebe98/g219BcGYS6hmjcSW/images/core-platform/configure/goal-settings/third-party-analytics/step_7_stored_events.jpg?fit=max&auto=format&n=g219BcGYS6hmjcSW&q=85&s=b560a816501c5ae145856a884f91f591" alt="Google Analytics events view showing chatbot gambit actions and user response labels" width="1770" height="768" data-path="images/core-platform/configure/goal-settings/third-party-analytics/step_7_stored_events.jpg" />
</Frame>

***

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Where do I find my GA4 Measurement ID?">
    In your Google Analytics account, go to **Admin** → **Data Streams** → select your web stream. The Measurement ID is displayed at the top and starts with `G-`.
  </Accordion>

  <Accordion title="What's the difference between 'All responses' and 'Goal Gambit only'?">
    **All responses** tracks every single user interaction as an event — useful for detailed engagement analysis. **Goal Gambit only** tracks just the conversion-critical interactions, keeping your event data focused on what matters most for measuring ROI.
  </Accordion>

  <Accordion title="Why don't I see any data in Google Analytics?">
    Give it a few minutes after saving. If data still doesn't appear, verify that your Measurement ID is correct and that your chatbot is published and accessible. Check Realtime Overview first, as historical reports can take up to 24 hours to populate.
  </Accordion>

  <Accordion title="Can I use Google Tag Manager instead?">
    Currently, the integration uses the GA4 Measurement ID directly. If you need Google Tag Manager support, contact the Tars support team for guidance.
  </Accordion>
</AccordionGroup>
