# Search Console and Google Analytics

> Your own measured search performance and what visitors did next. Free, because it is your data.

Source: https://docs.indexzero.site/tools/search-console-and-analytics



These five 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](/guides/integrations).

When the question is about the user's own site, prefer these over paid estimates: they are measured, not modelled.

## Shared date arguments [#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` [#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` [#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` [#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. |

## `get_analytics_report` [#get_analytics_report]

Run one of the project's GA4 reports. Pairs with Search Console: Search Console says how people arrived, GA4 says what they did next.

| Argument               | Type                                                                                                                                      | Required | Default          | Meaning                                                                                                                                                                |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectId`            | string                                                                                                                                    | yes      |                  |                                                                                                                                                                        |
| `kind`                 | `landing_pages`, `page_performance`, `key_events`, `traffic_acquisition`, `ecommerce_performance`, `site_search`, or `audience_breakdown` | yes      |                  | `landing_pages` and `page_performance` answer "which pages work"; `traffic_acquisition` compares channels; `key_events` and `ecommerce_performance` cover conversions. |
| `channel`              | `organic_search` or `all`                                                                                                                 | no       | `organic_search` |                                                                                                                                                                        |
| `days`                 | integer, 1 to 365                                                                                                                         | no       | 28               | Trailing window.                                                                                                                                                       |
| `startDate`, `endDate` | `YYYY-MM-DD`                                                                                                                              | no       |                  | Explicit window.                                                                                                                                                       |
| `limit`                | integer, 1 to 500                                                                                                                         | no       | 100              |                                                                                                                                                                        |

## `get_search_opportunities` [#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      |
