> For the complete documentation index, see [llms.txt](https://realty-ai.gitbook.io/realty-ai-support-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realty-ai.gitbook.io/realty-ai-support-docs/crm-integration/google-analytics-ga4.md).

# Google Analytics (GA4)

Connecting your GA4 CRM to Realty AI Chatbot.

## Google Analytics 4 (GA4) Setup for Realty AI

Realty AI tracks chatbot interactions and lead events in your Google Analytics 4 property using the GA4 Measurement Protocol. This is a server-side integration, no additional scripts or tags need to be installed on your website.

To enable this, we just need two things from your GA4 account: your **Measurement ID** and a **Measurement Protocol API Secret**.

***

### What You'll Need

* Access to your Google Analytics 4 property (Admin permissions required)
* Your GA4 **Measurement ID** (starts with `G-`)
* A **Measurement Protocol API Secret**

***

### Step 1: Find Your Measurement ID

* Log in to [Google Analytics](https://analytics.google.com)
* Click **Admin** (gear icon) in the bottom-left corner
* Under your property, click **Data Streams**

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2F1K01YmwcVTAq0fyOgAXZ%2FScreenshot%202026-03-10%20at%206.40.08%E2%80%AFPM.png?alt=media&amp;token=fbb0ca0a-2ec9-4a8a-a975-ce3ecdf1526f" alt=""><figcaption></figcaption></figure>

* Click on your **web data stream** (the one for your website)
* Your **Measurement ID** is displayed in the top-right of the stream details panel — it starts with `G-` followed by a mix of letters and numbers (e.g., `G-9S8LHBZMK7`)
* Click the copy icon next to it to copy it

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2FJ6woD71H7MWnoyLjAL1r%2FScreenshot%202026-03-10%20at%206.49.40%E2%80%AFPM.png?alt=media&amp;token=0eb870a7-fcb3-4bff-b84e-b9bc64fe5610" alt=""><figcaption></figcaption></figure>

### Step 2: Create an API Secret

1. On the same Data Stream page, click **Measurement Protocol API secrets**
2. Click **Create**, name it `Realty AI`, then click **Create**
3. Copy the **Secret value**

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2FsCIBVeq3G7jF8BOOWv2B%2FScreenshot%202026-03-10%20at%206.42.04%E2%80%AFPM.png?alt=media&amp;token=89e4bec8-b9c8-41c9-9246-a637250a7ef8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2FPXb83xvlT7mEfmOYlCb8%2FScreenshot%202026-03-10%20at%206.44.28%E2%80%AFPM.png?alt=media&amp;token=0c892627-2fb4-49a6-8a6b-7c59403a824a" alt=""><figcaption></figcaption></figure>

### Step 3: Copy Both to Realty AI Dashboard

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2F0uDfCBCG8q6guLn3DGCj%2FScreenshot%202026-04-14%20at%203.43.57%E2%80%AFPM.png?alt=media&amp;token=5e6ca298-421b-4e2f-94d5-83eb25500d1a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2760156511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FstnWhTwl45rHLlLKTZYT%2Fuploads%2FGoJ8DSsEBptx14BNKdcx%2FScreenshot%202026-04-14%20at%203.44.24%E2%80%AFPM.png?alt=media&amp;token=1500d8b0-a610-4a71-9c3f-e8d4f3631323" alt=""><figcaption></figcaption></figure>

| Field              | Example                   |
| ------------------ | ------------------------- |
| **Measurement ID** | `G-9S8LHABCD6`            |
| **API Secret**     | `l4PN-81m4stW64zUg1skfdi` |

**Step 4: Mark `chatbot_contact_created` as a Key Event (Required for Google Ads)**

Once Realty AI is connected, chatbot events will begin appearing in your GA4 property, including `chatbot_opened`, `chatbot_conversation_started`, `chatbot_message_sent`, and `chatbot_contact_created`. The most important of these is `chatbot_contact_created` -- this fires when a lead is captured by the chatbot.

To use this for Google Ads conversion tracking:

1. In GA4, go to **Admin > Data Display > Events**
2. Find `chatbot_contact_created` in the event list
3. Click the **star icon** to the left of the event name to mark it as a Key Event
4. In Google Ads, link your GA4 property under **Tools > Conversions** and import the Key Event

> Note: It may take **24-48 hours** for the event to appear in your list after the chatbot starts receiving conversations, and another **24-48 hours** after marking it as a Key Event for it to show up in Google Ads.
