# Google Analytics

> Send chats, carts and sales from chat to GA4.

Source: https://anystoreai.com/docs/marketing/google-analytics/  
Last updated: 2026-10-22

Connect Google Analytics 4 to see chats, carts and sales from chat in GA4. Go to **Integrations > Google Analytics**. On Growth and Pro. Each store has its own connection.

## Events

| Event | Sent when |
|---|---|
| asai_chat_started | A shopper starts a chat |
| asai_cart_from_chat | The assistant builds a cart. Shopify stores only |
| asai_purchase_from_chat | A paid order comes from a chat. Shopify stores only |

Events are sent from our server with the GA4 Measurement Protocol. When the shopper's browser has a GA4 cookie, the event joins their own GA4 visit. Test chats from the dashboard send nothing.

## Connect

Don't have Google Analytics? Create a free GA4 property at [analytics.google.com](https://analytics.google.com/).

1. **Copy the Measurement ID.** In GA4, go to **Admin > Data streams** and open your web stream. It starts with G-.
2. **Create an API secret.** On the same stream, open **Measurement Protocol API secrets** and select **Create**.
3. **In Any Store AI, go to Integrations > Google Analytics**, paste both and select **Connect**.
4. **Select Send test event**, then open **Admin > DebugView** in GA4 to see it arrive.

> [!NOTE]
> GA4 accepts every event without saying whether the Measurement ID and API secret are right. If the test event doesn't show in DebugView within a few minutes, check both.

## If something goes wrong

- **Needs attention** means the last event couldn't be sent and won't be retried. Check the Measurement ID and API secret.
- If GA4 doesn't answer, we try again after 5 and 30 minutes.
- If you move to Free, the card shows **Paused** and no events are sent.
- **Disconnect** stops events for this store. Any still waiting are dropped.
