Google Analytics 4
Reports of the GA4 properties one Google account can read, through Google's Data API, and the accounts, properties, custom dimensions and key events they name. No BigQuery export needed; the connection only reads.
Connected once, used everywhere.
Connections are declared in your repository and authorised in the console. The credentials stay with the platform; apps, pipelines, workflows and the agent use them under the same roles.

What the connection reaches
- Standard, pivot, batch and realtime reports by property
- Accounts, properties, data streams, custom dimensions and key events
- Read only
- Status
- Built into the pipeline SDK
- Connection class
- GoogleAnalyticsConnection
- Credential
- Google account with Viewer access to the GA4 properties
Connect Google Analytics 4
Three steps, the same for every connection. The credential goes to the platform, never into the repository or pipeline code.
- 1
Declare it in connections/connections.py
connections/connections.py from segmentstream_connections import GoogleAnalyticsConnection connections = ( GoogleAnalyticsConnection(key="google_analytics"),) - 2
Deploy
$ segmentstream deploy - 3
Connect
Open the connection in the console and sign in with a Google account that can read the GA4 properties, or authorise it from the terminal. Tokens are refreshed by the platform; pipeline code never sees them.
$ segmentstream connection authorize google_analytics --open
Use it
Code asks for the connection by its key. The platform adds the credential on the way out.
import segmentstream as s with s.get_connection("google_analytics").get_http_client() as client: response = client.post( f"/properties/{property_id}:runReport", json={"dateRanges": [{"startDate": "28daysAgo", "endDate": "yesterday"}], "dimensions": [{"name": "date"}], "metrics": [{"name": "sessions"}]}, ) response.raise_for_status()Or ask your agent
“Load daily sessions and key events by channel from our GA4 property.”
Part of these solutions
More in Analytics & social
Want Google Analytics 4 set up for you?
Our forward-deployed engineers build one solution on your data, in your own workspace, as code you own. Tell us what you run today and what you want; your note goes straight to our founder.
- One solution, on your data, in your own workspace
- First version live in two weeks
- Parity proven before anything is switched off
- Fixed scope and price, credited to your contract if you continue
Not ready for a pilot? Send the form anyway with your question. An engineer will reply, not a sales rep.
How the pilot worksConnect what your company runs.
Our engineers build the first version on your data in two weeks, at a fixed price.
Or build it yourself with your coding agent:
curl -fsSL https://segmentstream.com/install.sh | sh