Search Console and Google Analytics
Your own measured search performance and what visitors did next. Free, because it is your data.
These tools read data from a Google Search Console property or a Google Analytics 4 property connected to the project. They are free and marked read-only. They fail with a NOT_CONNECTED or RECONNECT_REQUIRED error, with a hint, when the integration is missing or its access has lapsed. Connecting is done in the dashboard; see Integrations.
When the question is about the user's own site, prefer these over paid estimates: they are measured, not modelled.
Shared date arguments
get_search_console_performance and get_striking_distance take the same window:
| Argument | Type | Required | Default | Meaning |
|---|---|---|---|---|
projectId | string | yes | ||
dateRange | last_7_days, last_28_days, last_3_months, last_6_months, last_12_months, or last_16_months | no | last_28_days | Preset window. |
startDate | YYYY-MM-DD | no | Explicit start; overrides dateRange. | |
endDate | YYYY-MM-DD | no | Explicit end. | |
type | web, image, video, news, googleNews, or discover | no | web | Search surface. |
Search Console data lags by about three days; preset ranges end before the lag.
get_search_console_performance
Clicks, impressions, CTR, and average position, broken down by query, page, and date, with the previous period for comparison. The text lane shows totals and the top 50 queries; the structured result carries every row by query, page, and date.
get_striking_distance
Queries where the site already ranks in positions 5 to 20, the ones closest to page-one traffic, with the page currently ranking for each. These need a nudge, not new content.
inspect_urls
Google's own index status for specific URLs: whether they are indexed, when last crawled, the canonical Google chose, mobile usability, and rich-result status.
| Argument | Type | Required | Meaning |
|---|---|---|---|
projectId | string | yes | |
urls | string[], 1 to 10 items | yes | Must be on the connected property. |
Google Analytics tools
Search Console says how people arrived; Google Analytics says what they did next. Each question has its own tool, so an agent can pick one by name:
| Tool | Answers |
|---|---|
get_analytics_overview | Is traffic up or down? Totals against the previous period of the same length, plus a trend. |
get_analytics_landing_pages | Which pages visits start on, and whether those visits engage and convert. |
get_analytics_top_pages | The most viewed pages, counting every view. |
get_analytics_traffic_sources | Where visitors come from, by channel group, source and medium, or campaign. |
get_analytics_conversions | Each key event with its count and users, optionally split by landing page. |
get_analytics_ecommerce | Items viewed, added to cart, purchased and their revenue, or revenue by landing page. |
get_analytics_site_search | What visitors type into the site's own search box. |
get_analytics_audience | Visitors by device, country, or new versus returning. |
get_analytics_measurement_health | Whether the property is set up well enough to trust: web stream, key events, recent organic traffic. |
get_analytics_report | Any report kind with every option. Use it when the named tools do not expose what you need. |
Shared arguments
Every Google Analytics tool takes projectId. All of them except get_analytics_measurement_health also take a window:
| Argument | Type | Required | Default | Meaning |
|---|---|---|---|---|
days | integer, 1 to 365 | no | 28 | Trailing window, ending yesterday in the property's timezone. |
startDate, endDate | YYYY-MM-DD | no | Explicit window. Give both or neither; together they override days. | |
channel | organic_search or all | no | varies | organic_search keeps only Organic Search sessions; all includes every channel. |
channel defaults to organic_search everywhere except get_analytics_traffic_sources, which defaults to all, and get_analytics_site_search, which always covers every channel. When a report filtered to Organic Search comes back empty, the tool says so and suggests channel: "all".
The table-shaped tools (all except the overview and the health check) also page:
| Argument | Type | Required | Default | Meaning |
|---|---|---|---|---|
limit | integer, 1 to 500 | no | 100 | Rows to return. |
offset | integer, 0 or more | no | 0 | Rows to skip for the next page. |
Their result carries totalRows, the number of rows Google Analytics has for the query, and nextOffset, which is null on the last page.
get_analytics_overview
Sessions, active users, engaged sessions, engagement rate, key events, transactions and revenue for the window, the same figures for the previous window of the same length, and the change between them.
| Argument | Type | Default | Meaning |
|---|---|---|---|
trend | daily or weekly | daily | Granularity of the trend series. |
get_analytics_traffic_sources
| Argument | Type | Default |
|---|---|---|
breakdown | channel_group, source_medium, or campaign | channel_group |
get_analytics_conversions
Only events marked as key events in Google Analytics appear.
| Argument | Type | Default | Meaning |
|---|---|---|---|
breakdown | event or event_and_landing_page | event | Split each key event by the page the visit started on. |
get_analytics_ecommerce
Needs Google Analytics ecommerce events.
| Argument | Type | Default | Meaning |
|---|---|---|---|
breakdown | item or landing_page | item | One row per product, or transactions and revenue per entry page. |
onlyWithTransactions | boolean | false | With landing_page, drop pages that produced no transactions. |
get_analytics_site_search
Needs Google Analytics to record the view_search_results event, which enhanced measurement does for search URLs with a query parameter.
get_analytics_audience
| Argument | Type | Default |
|---|---|---|
breakdown | device, country, or new_vs_returning | device |
get_analytics_measurement_health
Takes only projectId. Run it when another Google Analytics tool returns empty or implausible numbers.
get_analytics_report
The escape hatch. Takes a kind (landing_pages, page_performance, key_events, traffic_acquisition, ecommerce_performance, site_search, or audience_breakdown) and every option the named tools expose, under their long names: breakdown, acquisitionBreakdown, ecommerceBreakdown, ecommerceOnlyWithTransactions, and audienceBreakdown. It also takes includeDate, which splits page_performance into one row per page per day. channel defaults to organic_search for every kind.
get_search_opportunities
Joins Search Console against Analytics to find pages that attract search traffic but under-convert, and queries with impressions that are not landing clicks. Requires both integrations.
| Argument | Type | Required | Default |
|---|---|---|---|
projectId | string | yes | |
days | integer, 1 to 365 | no | 28 |