B6AIDocs

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.

8 min read

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 will need
A Google Analytics account with administrator access, and a B6AI user with the Enterprise Admin role, integrations are configured once at the workspace level and shared by every bot.

What you can do with Google Analytics

Once connected, your bots and agents can use Google Analytics inside conversations and automations. Typical uses include:

  1. Log a GA4 event when a chat starts and when it completes.
  2. Track page views or custom events from bot flows.
  3. 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.

  1. A GA4 property with a Web data stream.
  2. Editor or Administrator access to that GA4 property, so B6AI can create the Measurement Protocol secret on your behalf.
  3. 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.

  1. Make sure the GA4 property you want has a Web data stream — app-only properties cannot receive Measurement Protocol events from B6AI.
  2. Sign in to Google with an account that has Editor or Administrator access to that property.
  3. 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.

  1. Unlike a manual setup, Google Analytics needs no Measurement ID, API secret or Google Cloud project from you — B6AI provides the Google app.
  2. The connection is created during Connect (next section), where you approve access and choose your property.
Keep secrets safe
Treat every token, key and secret like a password. Never commit them to source control, paste them into chat, or email them. B6AI stores them encrypted at rest, enter them only in the integration settings.

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.

  1. In B6AI, open Settings → Integrations and click Connect on the Google Analytics card.
  2. Approve the Google Analytics permissions on Google’s consent screen.
  3. Back in B6AI, pick the GA4 property and the web data stream you want events sent to, then click Connect.
json
{
  "provider": "google_analytics",
  "measurement_id": "G-XXXXXXX",
  "api_secret": "aB1cD2e…"
}
FieldWhat it isExample value
PropertyThe GA4 property events are reported againstAcme — Acme Website
Data streamThe web stream within that property; its Measurement ID is read automaticallyAcme Web (G-XXXXXXX)

Verify the connection

Confirm the integration is live before you rely on it in a bot.

  1. Confirm the Google Analytics card shows “Connected”.
  2. Fire a test event from B6AI (or start a test chat).
  3. In GA4, open Reports → Realtime or Admin → DebugView and confirm the event arrives.
Connected
A green “Connected” status plus a successful test confirms Google Analytics is ready to use in your bots, action nodes and automations.

Troubleshooting

If the connection fails or an action does not work, match the symptom below to its cause and fix.

Symptom / errorLikely causeHow to fix it
No properties listed after connectingThe Google account has no GA4 properties, or only view-level accessReconnect with an account that has Editor or Administrator access to the property
The property you want has no selectable streamIt has no Web data streamAdd a Web stream in GA4 (Admin → Data streams), then reconnect
Connecting fails when choosing a streamThe account cannot create a Measurement Protocol secret on that streamEditor or Administrator access is required — a Viewer or Analyst cannot create one
Events never appearThe connection was made against a different property than the one you are looking atCheck the Measurement ID shown on the card matches the stream you are viewing in GA4
Event shows in DebugView but not in reportsNormal processing delayStandard 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.

  1. The Measurement Protocol is send-only, B6AI writes events and cannot read GA4 reports.
  2. Only Web data streams are supported; app streams use a Firebase app id rather than a Measurement ID.
  3. Events may take time to appear in standard reports; use Realtime/DebugView for immediate confirmation.
  4. GA4 validates event names and parameters; malformed events are silently dropped.
Rate limits
GA4 Measurement Protocol accepts high event volumes but enforces payload and per-request limits; B6AI batches and retries as needed.

Security best practices

  1. Grant only the scopes and permissions listed above, never request more “just in case”.
  2. Rotate your Google Analytics connection on a regular schedule, and immediately if you suspect exposure.
  3. Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
  4. Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
  5. Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
  6. Disconnect the integration the moment a credential leaks; then rotate it in Google Analytics before reconnecting.

Recommendations

  1. Test against a sandbox or non-production Google Analytics account before connecting live data.
  2. Document which bots and flows depend on this integration so changes are predictable.
  3. Set a recurring reminder to review scopes and rotate credentials.
  4. Enable only the capabilities you actually use today; you can widen scopes later.
Was this page helpful?