ga4_run_funnel_report
Google Analytics 4 read low risk
Part of the Funnel Agent.
What it does
Run a GA4 funnel report (Analytics Data API v1alpha properties.runFunnelReport): how many users reach each step of a sequence (e.g. page_view -> form_start -> generate_lead), the completion and abandonment rate per step, optionally broken down by a dimension (deviceCategory, country) and with what users did next. Each step is {name, event} for a one-event step, or {name, filterExpression} for anything richer (events with parameters, page paths, OR groups), plus optional isDirectlyFollowedBy and withinDurationFromPriorStep. Closed funnel by default (users must enter at step 1); is_open_funnel lets them enter at any step. Returns Google's {funnel_table, funnel_visualization} sub-reports (dimension_headers, metric_headers, rows: funnelStepName with activeUsers, funnelStepCompletionRate, funnelStepAbandonments, funnelStepAbandonmentRate). ALPHA: Google serves funnels only from its v1alpha API ("introduced at alpha stability"), so field names may change; the numbers match GA4's Funnel exploration for the same steps and dates. Read-only.
When to use it
Use when the user asks where visitors drop off between steps (landing page -> form -> lead, product -> cart -> purchase), for a CRO audit, or to compare a funnel by device or channel. Check the event names first with ga4_list_key_events or ga4_get_metadata.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
property_id | string | yes | GA4 property number (e.g. 123456789) or properties/123456789. From ga4_list_accounts_properties. |
steps | array<object> | yes | Ordered steps, at least one: [{'name':'Visit','event':'page_view'},{'name':'Lead','event':'generate_lead'}]. A step may instead carry filterExpression (a FunnelFilterExpression: funnelEventFilter, funnelFieldFilter, andGroup, orGroup, notExpression) and isDirectlyFollowedBy / withinDurationFromPriorStep ('3600s'). |
date_ranges | array<object> | no | [{startDate,endDate}] as YYYY-MM-DD or relative ('30daysAgo', 'yesterday', 'today'), in the property's time zone. |
is_open_funnel | boolean | no | true lets users enter at any step; default false (closed: step 1 first). |
breakdown_dimension | string | no | Split every step by this dimension, e.g. deviceCategory, country, sessionDefaultChannelGroup. |
breakdown_limit | integer | no | Breakdown values shown, 1-15 (Google's default 5). |
next_action_dimension | string | no | What users did after each step: eventName or pagePath. |
next_action_limit | integer | no | Next actions shown per step. |
visualization | string | no | STANDARD_FUNNEL (default) or TRENDED_FUNNEL (by date); 'standard'/'trended' accepted. |
segments | array<object> | no | Up to 4 GA4 Segment objects (userSegment, sessionSegment or eventSegment) to compare groups of users. |
dimension_filter | object | no | FilterExpression applied to the funnel's breakdown and next-action dimensions. |
limit | integer | no | Rows per sub-report (Google's default 10,000). |
Safeguards
Policy
GA4 is a separate Google product, scope and property from Google Ads: read only what the connected Google account is authorized to see (analytics.readonly), never another tenant's properties, and never merge GA4 figures with Google Ads figures without labeling each.
Reminder
Funnel counts are GA4 users on the property's own event names and time zone; label them as GA4, not Google Ads conversions.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
permission_denied | The connected Google account has no access to that property. | Ask the property's admin to add that Google account as Viewer (GA4 Admin -> Property access management). | no |
needs_reauth | The Google connection's token is dead, or it was made before Scalix asked for Google Analytics. | Reconnect Google in the Scalix dashboard and accept the Google Analytics permission. | no |
invalid_argument | GA4 rejected the request, or a field is malformed; the message names the field. | Fix what the message names (check names with ga4_get_metadata) and call again. | no |
Edge cases
- An event name that never fired gives a step with 0 users, not an error: check the names with ga4_get_metadata.
- A closed funnel counts only users who did step 1 in the date range; is_open_funnel=true counts later steps on their own.
- Funnels are alpha in Google's API: a field Google renames fails with invalid_argument naming it.