hermosodocs

analytics_report

Run a GA4 report read-only

Area: GOOGLE ANALYTICS · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

WHAT HAPPENED ON THE SITE — the GA4 Data API report, and the tool that answers "where is our traffic coming from", "which campaign converted", "which landing page is working". Pass metrics by name (activeUsers, sessions, screenPageViews, conversions, totalRevenue, engagementRate, bounceRate, averageSessionDuration …) and dimensions to break them down by (sessionDefaultChannelGroup, sessionSource / sessionMedium / sessionCampaignName, landingPage, pagePath, country, deviceCategory, date, eventName …). GA4 publishes hundreds of both and each property ships its OWN custom dimensions, so names are forwarded as given rather than validated against a copied list — use list_analytics_definitions to see a property's custom ones. THE PROPERTY IS A NUMERIC ID (e.g. 123456789), NOT the G-XXXXXXX Measurement ID — run list_analytics_properties to resolve it. Dates default to the last 28 days and accept either YYYY-MM-DD or GA4's relative forms ("28daysAgo", "yesterday", "today"). PERIOD OVER PERIOD IN ONE CALL: compare:"previous_period" (or "previous_year") adds the earlier period and returns per-period totals plus `change` (absolute + %) computed from GA4's own totals — quote it, never redo the maths; or pass up to 4 named dateRanges. comparisons put segments side by side; totals:true adds a total row. Rows come back as flat named objects. When GA4 says the data is SAMPLED, TRUNCATED, rolled into an "(other)" row or thresholded, completenessNotes says so in words; repeat those when reporting. Read-only, 0 credits.

Parameters

ParameterTypeDescription
propertyrequiredstringthe NUMERIC GA4 property id from list_analytics_properties (e.g. "123456789") — never the G-XXXXXXX Measurement ID, and it must be one SHARED with this profile
metricsstring[]GA4 metric names — default ["activeUsers","sessions","screenPageViews"]
dimensionsstring[]GA4 dimension names to break the metrics down by — omit for a single total row
startDatestringYYYY-MM-DD or a GA4 relative date like "28daysAgo" (default 28daysAgo)
endDatestringYYYY-MM-DD or "today" (default today)
limitnumberrows to return, 1–250000 (default 50). 250,000 is GOOGLE's per-request maximum, not ours — asking for more is silently capped there.
offsetnumberskip this many rows — how you page past `limit`. Use the nextOffset the previous call returns.
orderByMetricstringsort by this metric — must be one of the metrics requested
orderDescbooleandefault true (largest first) when orderByMetric is set
dimensionFilterobjectNARROW THE REPORT — a GA4 FilterExpression, exactly one of andGroup | orGroup | notExpression | filter. Without it a report is the WHOLE property. Example: {"filter":{"fieldName":"sessionSource","stringFilter":{"matchType":"EXACT","value":"google"}}}; combine with {"andGroup":{"expressions":[…]}}. METRICS CANNOT BE USED HERE — use metricFilter.
metricFilterobjectFilter the AGGREGATED rows, GA4's having-clause — same FilterExpression shape. Example: {"filter":{"fieldName":"sessions","numericFilter":{"operation":"GREATER_THAN","value":{"int64Value":"30"}}}}. DIMENSIONS CANNOT BE USED HERE — use dimensionFilter.
compare"previous_period" | "previous_year"also read the period before startDate–endDate (or the same dates a year earlier) and return `change`
dateRangesobject[]up to 4 periods instead of startDate/endDate; rows gain a dateRange column; with two, change = the FIRST relative to the SECOND
dateRanges[].startDaterequiredstringperiod start, YYYY-MM-DD or a GA4 relative date such as 28daysAgo
dateRanges[].endDaterequiredstringperiod end, YYYY-MM-DD or today
dateRanges[].namestringlabel for this period, shown in the dateRange column
totalsbooleanadd TOTAL rows
aggregations"TOTAL" | "MINIMUM" | "MAXIMUM" | "COUNT"[]extra summary rows over the result: TOTAL, MINIMUM, MAXIMUM or COUNT
comparisonsobject[]segments side by side: [{name, dimensionFilter}] or [{comparison:"comparisons/123"}]; adds a comparison column
comparisons[].namestringlabel for this segment; becomes the value of the comparison column
comparisons[].dimensionFilterobjectFilterExpression selecting this segment, same shape as dimensionFilter
comparisons[].comparisonstringsaved GA4 comparison id such as comparisons/1234; use instead of name and dimensionFilter
orderByobject[][{dimension:"date"}] or [{metric:"sessions", desc:true}]
orderBy[].dimensionstringdimension to sort by; use instead of metric
orderBy[].metricstringmetric to sort by; use instead of dimension
orderBy[].descbooleantrue = largest or latest first
orderBy[].orderType"ALPHANUMERIC" | "CASE_INSENSITIVE_ALPHANUMERIC" | "NUMERIC"dimension sort order: ALPHANUMERIC, CASE_INSENSITIVE_ALPHANUMERIC or NUMERIC
keepEmptyRowsbooleantrue = keep rows whose metrics are all zero
currencyCodestringISO 4217, e.g. EUR — default the property currency

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/analytics_report.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"analytics_report","arguments":{"property":"<string>"}}}

CLI

hermoso call analytics_report --json '{"property":"<string>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json