GA4 and Yandex Metrika data

Read page views and traffic from GA4 and Yandex Metrika, then join them with crawl findings to fix the pages people actually visit. Both connections are read-only.

What it does

Yandex Metrika

metrika-counters finds the counter ID. metrika-setup shows its goals, filters and data operations, which you should read before drawing conclusions. metrika-report then pulls any metrics and dimensions you ask for, with automatic pagination.

  • Access is a Yandex OAuth token in YANDEX_METRIKA_TOKEN or its token file.
  • metrika-traffic-pdf builds an A4 traffic report as HTML and PDF. The PDF needs a local Chrome, Edge or Chromium.
  • Raw logs are excluded on purpose, because they hold visitor identifiers.

Google Analytics 4

GA4 has no dedicated CLI command. You collect it with provider-collect, using the page_views operation for visited pages or landing_pages for landing pages. page_views counts screenPageViews by date, host and path for a property you name.

  • Access is a GA4 access token (GA4_ACCESS_TOKEN) or a Google service account with the analytics.readonly scope.
  • The account needs read access to the property.
  • Raw rows go to a private local artifact folder, not into the tool response.

Join to the crawl

crawl-enrich matches a URL-keyed traffic CSV to crawled URLs and adds analytics findings, using the visits and bounce-rate columns you name. With a project, sources-sync keeps daily history in a local SQLite file, and sf run joins it to audit pages offline.

  • Orphan, no-data and non-indexable-with-traffic findings come from the join.
  • Matched, crawl-only and external-only URLs stay separate populations.
  • GA4 and Metrika numbers are never summed together.

Three steps, one saved scan

  1. Check the counter setup first

    Run metrika-counters to find the counter ID, then metrika-setup to see its goals, filters and data operations.

  2. Pull visits and page views

    metrika-report reads Yandex Metrika with any metrics and dimensions. GA4 page views come from provider-collect with the ga4 page_views operation.

  3. Join the numbers to the crawl

    crawl-enrich matches the traffic CSV to crawled URLs by URL and adds analytics findings, including the visits and bounce-rate columns.

Checks in this feature

CheckWhat it meansSeverityEvidence
GA_ORPHAN_URLThe analytics data names a same-origin URL that the crawl did not findImportantURL list from the join. Withheld on a partial crawl
NON_INDEXABLE_WITH_GA_DATAA non-indexable page still gets visits above zeroImportantURL and visit count from --visits-column
NO_GA_DATAAn indexable crawled page has no analytics rowTipURL list. Review the measured period and the analytics tagging before you act on it
BOUNCE_RATE_ABOVE_70The page bounce rate is above 70%TipURL and bounce rate from --bounce-column

One command

bash
spiderhead metrika-report --counter 12345678 --date1 2026-09-01 --date2 2026-09-30

Install first: installation guide. Every command also runs as an MCP tool for AI agents.

What you need

  • Yandex Metrika: a counter ID and an OAuth token
  • GA4: a property ID and an access token or service account with analytics.readonly
  • A date range
  • A crawl or audit, plus a traffic CSV if you use crawl-enrich

Limits

  • GA4 page views are not sessions, users or landing-page sessions, and are not evidence that a change caused traffic.
  • GA4 collection returns at most 100,000 rows per run. Thresholded or sampled data is flagged.
  • Zero visits can come from tagging or filters, so check metrika-setup first.
  • Missing rows are not measured zeros. A negative finding needs a complete crawl and complete provider coverage.

Questions

Does it change my site or my analytics settings?
No. Every call is read-only. metrika-setup only shows how a counter is set up. Saved evidence stays in a local folder.
Which access do I need?
For Metrika, a Yandex OAuth token in the YANDEX_METRIKA_TOKEN setting or its token file. For GA4, a GA4_ACCESS_TOKEN or a service account with the analytics.readonly scope and read access to the property.
Why does a page with zero visits not always mean a problem?
Zero can come from setup. With no goals or filters configured, the numbers can be incomplete. Check metrika-setup before you draw conclusions from the traffic.
Does it read raw visitor logs?
No. Metrika raw logs are excluded by design because they contain visitor identifiers. The tool uses aggregate reports only.
What does it cost?
SpiderHead charges nothing for these commands. Calls count against the Metrika and GA4 API quotas of your own account.
What is stored on my machine?
GA4 raw rows go to a private artifact folder that you choose. sources-sync writes daily history to a project SQLite file without storing tokens. metrika-report prints its result; save it yourself if you need it.

Try it on your own site