Swarmz
IntegrationsGoogle Workspace and Cloud

Google Analytics

Add GA4 page-view, event, and conversion tracking to a generated app

Connect Google Analytics when a generated app needs browser-side GA4 tracking. The connector returns a validated public measurement ID and the official Google tag loader URL.

This connector does not read Analytics reports. It also does not send server-side Measurement Protocol events, because that requires a separate API secret that Swarmz does not collect here.

Availability

A Swarmz administrator must show Google Analytics under Platform config > Integrations and enable the data and analytics connector flag. GA4 measurement IDs are public configuration, so no OAuth application is required.

Connect Google Analytics

  1. In Google Analytics, open the GA4 web data stream and copy its measurement ID. It starts with G-. Google documents the gtag installation sequence.
  2. In the Swarmz project, open Settings > Integrations and select Google Analytics.
  3. Enter the measurement ID in the API key field.
  4. Select Save connection.

Swarmz validates the ID format. The generated app can then request the measurement ID and the www.googletagmanager.com loader URL. No Google account access or reporting permission is granted.

Available operations

OperationWhat it doesLimit per minute
public_configReturns the browser-safe measurement ID and gtag loader URL10

Ask the AI to use Google Analytics

  • “Install GA4 on every published route and track page views after client-side navigation.”
  • “Send a sign_up event after account creation.”
  • “Mark a completed purchase as a conversion without placing private order data in the event.”

The AI requests the connector when it first adds tracking. It must not claim that the same connection can query traffic reports or manage Analytics properties.

Verify Google Analytics

  1. Publish or preview the app and open it with browser developer tools.
  2. Confirm the gtag script URL contains the expected G- measurement ID.
  3. Trigger one test event.
  4. Check GA4 DebugView or Realtime and confirm the event appears for the intended property.

If events reach the wrong property, edit the connection and enter the correct measurement ID. To remove tracking, ask the AI to remove the gtag setup, then select Remove in Swarmz.

On this page