IndexZeroDocs

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:

ArgumentTypeRequiredDefaultMeaning
projectIdstringyes
dateRangelast_7_days, last_28_days, last_3_months, last_6_months, last_12_months, or last_16_monthsnolast_28_daysPreset window.
startDateYYYY-MM-DDnoExplicit start; overrides dateRange.
endDateYYYY-MM-DDnoExplicit end.
typeweb, image, video, news, googleNews, or discovernowebSearch 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.

ArgumentTypeRequiredMeaning
projectIdstringyes
urlsstring[], 1 to 10 itemsyesMust 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:

ToolAnswers
get_analytics_overviewIs traffic up or down? Totals against the previous period of the same length, plus a trend.
get_analytics_landing_pagesWhich pages visits start on, and whether those visits engage and convert.
get_analytics_top_pagesThe most viewed pages, counting every view.
get_analytics_traffic_sourcesWhere visitors come from, by channel group, source and medium, or campaign.
get_analytics_conversionsEach key event with its count and users, optionally split by landing page.
get_analytics_ecommerceItems viewed, added to cart, purchased and their revenue, or revenue by landing page.
get_analytics_site_searchWhat visitors type into the site's own search box.
get_analytics_audienceVisitors by device, country, or new versus returning.
get_analytics_measurement_healthWhether the property is set up well enough to trust: web stream, key events, recent organic traffic.
get_analytics_reportAny 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:

ArgumentTypeRequiredDefaultMeaning
daysinteger, 1 to 365no28Trailing window, ending yesterday in the property's timezone.
startDate, endDateYYYY-MM-DDnoExplicit window. Give both or neither; together they override days.
channelorganic_search or allnovariesorganic_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:

ArgumentTypeRequiredDefaultMeaning
limitinteger, 1 to 500no100Rows to return.
offsetinteger, 0 or moreno0Rows 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.

ArgumentTypeDefaultMeaning
trenddaily or weeklydailyGranularity of the trend series.

get_analytics_traffic_sources

ArgumentTypeDefault
breakdownchannel_group, source_medium, or campaignchannel_group

get_analytics_conversions

Only events marked as key events in Google Analytics appear.

ArgumentTypeDefaultMeaning
breakdownevent or event_and_landing_pageeventSplit each key event by the page the visit started on.

get_analytics_ecommerce

Needs Google Analytics ecommerce events.

ArgumentTypeDefaultMeaning
breakdownitem or landing_pageitemOne row per product, or transactions and revenue per entry page.
onlyWithTransactionsbooleanfalseWith landing_page, drop pages that produced no transactions.

Needs Google Analytics to record the view_search_results event, which enhanced measurement does for search URLs with a query parameter.

get_analytics_audience

ArgumentTypeDefault
breakdowndevice, country, or new_vs_returningdevice

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.

ArgumentTypeRequiredDefault
projectIdstringyes
daysinteger, 1 to 365no28

On this page