Connect Google Analytics
Connect a GA4 property to a Loops AI agent with read-only OAuth. Loops AI reads your reports through the GA4 Data API and never writes to GA4 or Google Tag Manager.
Connecting Google Analytics links a GA4 property to your agent so Loops AI can measure the product views, clicks, and downstream sales it drives, and show them in your dashboard. The connection is read-only: Loops AI reads your GA4 reports and never writes to your GA4 property or Google Tag Manager.
What the connection does
After you complete the OAuth flow:
- Loops AI lists the GA4 properties and web data streams on your Google account.
- You pick the property and data stream for the site where the widget is embedded.
- Loops AI stores the property and its measurement ID (
G-XXXX) in your agent configuration. No tags, triggers, or GTM workspaces are created.
Loops AI then reads aggregated metrics back from that property through the GA4 Data API to power the "sales generated by Loops AI" report in your dashboard.
How events reach GA4
The widget pushes GA4-standard ecommerce events (view_item_list, select_item) into window.dataLayer, each carrying the Loops AI signature item_list_id: "loopsai". Your existing GTM ecommerce setup forwards them to GA4 exactly as it forwards your own events. Loops AI does not create or modify any GTM tag — it only reads the results back.
Loops AI requests a single scope, analytics.readonly. It can read your GA4 configuration (properties and data streams) and report data; it cannot write to GA4, and it never accesses Google Tag Manager. The OAuth refresh token is stored in GCP Secret Manager; the connection record lives under your agent configuration and is not exposed via the Loops AI API.
How to connect
Open the agent's web channel analytics
In the Loops AI dashboard, open your agent → Analytics → Web channel.
Connect Google Analytics
Click Connect Google Analytics. A Google OAuth popup opens. Choose the Google account that has access to your GA4 property.
The account you authorize must be one you can sign in to in this browser.
Authorize Loops AI (read-only)
Grant the single requested scope:
| Scope | Why it is needed |
|---|---|
analytics.readonly | Read your GA4 properties and data streams, and read report data through the GA4 Data API. |
No Tag Manager scope is requested, and Loops AI cannot write to your GA4 property.
Pick your property and data stream
Loops AI lists the GA4 properties on your account. Choose:
- The GA4 property for the site where the widget is embedded.
- The web data stream within that property.
Then click Save.
Done
The connection is live. Your dashboard shows the connected measurement ID and property, and the "sales generated by Loops AI" report populates as data arrives.
While the app is in Google's verification process, the consent screen may label it as unverified. You can continue safely via Advanced → Go to Loops AI.
If your events don't reach GA4
Most stores already forward GA4-standard ecommerce events through GTM, so no extra work is needed. If yours does not, add a one-time recipe in your own GTM (Loops AI never writes it for you):
- Create a Custom Event trigger for
view_item_listand one forselect_item. - Create a GA4 event tag bound to your measurement ID for each.
- Publish the container.
The Loops AI widget never loads the gtag.js library itself. Events reach GA4 only through your GTM container reading window.dataLayer.
To measure downstream conversions (add-to-cart, purchase, revenue), see Conversion Attribution.