Skip to main content
Glama

QuerySail: Google Analytics

Compare Google Analytics periods

compare_report
Read-onlyIdempotent

Use this when the user asks what changed between two periods, why traffic or conversions went up or down, or which channels, sources, pages or countries gained or lost. Compares metrics for one property between a current period and the previous period (default), the same weekdays a year earlier, or custom dates, in one Google request. Returns each metric's totals with absolute and percent change and, with a dimension, the top gainers and losers ranked by change in one metric. With no dates the current period is the last 28 days ending yesterday. Filters apply to both periods. Changes are observed differences and do not identify causes. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moversNoGainers and losers to return each. Default 10, maximum 50.
filtersNoAll filters are combined with AND. A filter on a requested metric is numeric (equals, notEquals, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual with a number value); any other field is a dimension filter with a string operator.
metricsNoMetric API names to compare. Default activeUsers, sessions, screenPageViews.
rank_byNoMetric to rank movers by. Must be one of metrics. Default the first metric.
end_dateNoCurrent period end: YYYY-MM-DD, 'today', 'yesterday' or 'NdaysAgo' (e.g. '28daysAgo'), in the property's time zone. Provide together with start_date.
dimensionNoOptional breakdown for top gainers and losers, e.g. 'sessionDefaultChannelGroup', 'sessionSourceMedium', 'landingPage', 'country'. Not a time dimension.
compare_toNo'previous_period' (default) is the same number of days immediately before; 'previous_year' is 52 weeks earlier, so weekdays line up; 'custom' uses compare_start_date and compare_end_date.
start_dateNoCurrent period start: YYYY-MM-DD, 'today', 'yesterday' or 'NdaysAgo' (e.g. '28daysAgo'), in the property's time zone. Provide together with end_date.
property_idYesExact property ID from list_properties, e.g. 'properties/123456789'.
connection_idNoOptional: force a specific Google connection when the property is visible to several.
compare_end_dateNoComparison period end for compare_to 'custom'.
compare_start_dateNoComparison period start for compare_to 'custom'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNo
unitsNo
losersNo
totalsNo
gainersNo
requestNo
coverageNo
propertyNo
freshnessNo
requestIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.