Connect Google Analytics to B6AI
Set up the Google Analytics integration end to end, from creating credentials in Google Analytics to verifying the live connection and using it in your bots.
Overview
The Google Analytics (GA4) integration lets B6AI send events to your GA4 property so you can measure chatbot activity, chats started and completed, widget engagement and custom events, alongside the rest of your site analytics.
It is send-only: B6AI writes events to GA4 and never reads or changes your existing data.
What you can do with Google Analytics
Once connected, your bots and agents can use Google Analytics inside conversations and automations. Typical uses include:
- Log a GA4 event when a chat starts and when it completes.
- Track page views or custom events from bot flows.
- Measure widget engagement and conversions alongside your web analytics.
How the integration works
You connect with Google — B6AI uses its own Google app, so there is no Measurement ID or API secret to find and copy.
Clicking Connect sends you to Google to sign in and approve access to Google Analytics. B6AI then lists the GA4 properties your account administers and you pick the property and web data stream events should go to.
B6AI reads that stream’s Measurement ID and creates a Measurement Protocol API secret named “B6AI” on it, then stores both encrypted at rest. Reconnecting reuses the same secret rather than creating another.
From then on B6AI posts events to GA4 server-side with the Measurement Protocol. Sending events never uses your Google sign-in.
Prerequisites
Make sure all of the following are in place before you start. Each one is required, skipping any will cause the connection to fail later.
- A GA4 property with a Web data stream.
- Editor or Administrator access to that GA4 property, so B6AI can create the Measurement Protocol secret on your behalf.
- The Enterprise Admin role in B6AI.
Create or prepare your Google Analytics account
If your organization does not already use Google Analytics, create an account first. Existing customers can skip to the next step.
- Make sure the GA4 property you want has a Web data stream — app-only properties cannot receive Measurement Protocol events from B6AI.
- Sign in to Google with an account that has Editor or Administrator access to that property.
- Nothing needs to be copied out of Google Analytics; B6AI reads the Measurement ID and creates the API secret for you.
Generate your Google Analytics connection
B6AI authenticates with Google Analytics using your Google Analytics connection. Follow these steps exactly, each field you copy here is entered into B6AI later.
- Unlike a manual setup, Google Analytics needs no Measurement ID, API secret or Google Cloud project from you — B6AI provides the Google app.
- The connection is created during Connect (next section), where you approve access and choose your property.
Connect Google Analytics in B6AI
Now enter your credentials in B6AI. Signed in as an Enterprise Admin, open Settings → Integrations, find the Google Analytics card and click Connect, then complete the form. Every field is explained below.
- In B6AI, open Settings → Integrations and click Connect on the Google Analytics card.
- Approve the Google Analytics permissions on Google’s consent screen.
- Back in B6AI, pick the GA4 property and the web data stream you want events sent to, then click Connect.
{
"provider": "google_analytics",
"measurement_id": "G-XXXXXXX",
"api_secret": "aB1cD2e…"
}| Field | What it is | Example value |
|---|---|---|
| Property | The GA4 property events are reported against | Acme — Acme Website |
| Data stream | The web stream within that property; its Measurement ID is read automatically | Acme Web (G-XXXXXXX) |
Verify the connection
Confirm the integration is live before you rely on it in a bot.
- Confirm the Google Analytics card shows “Connected”.
- Fire a test event from B6AI (or start a test chat).
- In GA4, open Reports → Realtime or Admin → DebugView and confirm the event arrives.
Troubleshooting
If the connection fails or an action does not work, match the symptom below to its cause and fix.
| Symptom / error | Likely cause | How to fix it |
|---|---|---|
| No properties listed after connecting | The Google account has no GA4 properties, or only view-level access | Reconnect with an account that has Editor or Administrator access to the property |
| The property you want has no selectable stream | It has no Web data stream | Add a Web stream in GA4 (Admin → Data streams), then reconnect |
| Connecting fails when choosing a stream | The account cannot create a Measurement Protocol secret on that stream | Editor or Administrator access is required — a Viewer or Analyst cannot create one |
| Events never appear | The connection was made against a different property than the one you are looking at | Check the Measurement ID shown on the card matches the stream you are viewing in GA4 |
| Event shows in DebugView but not in reports | Normal processing delay | Standard reports can take 24–48h; use Realtime/DebugView to verify quickly |
Limitations & rate limits
Keep these constraints in mind so your bots behave predictably at scale.
- The Measurement Protocol is send-only, B6AI writes events and cannot read GA4 reports.
- Only Web data streams are supported; app streams use a Firebase app id rather than a Measurement ID.
- Events may take time to appear in standard reports; use Realtime/DebugView for immediate confirmation.
- GA4 validates event names and parameters; malformed events are silently dropped.
Security best practices
- Grant only the scopes and permissions listed above, never request more “just in case”.
- Rotate your Google Analytics connection on a regular schedule, and immediately if you suspect exposure.
- Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
- Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
- Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
- Disconnect the integration the moment a credential leaks; then rotate it in Google Analytics before reconnecting.
Recommendations
- Test against a sandbox or non-production Google Analytics account before connecting live data.
- Document which bots and flows depend on this integration so changes are predictable.
- Set a recurring reminder to review scopes and rotate credentials.
- Enable only the capabilities you actually use today; you can widen scopes later.