agentleFS
AgentShekelAgentShekel/agentic-workflow/skills/yandex-metrika-guide/SKILL.md

yandex-metrika-guide

Skill4 starsChanged 29 days agoMITView on GitHub

[TOOL] Yandex Metrika API client (traffic overview, sources, devices, conversions, popular pages, audience geography, demographics). Preloaded by marketing-web-analyst and marketing-ppc-specialist agents.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All scripts accept --counter ID to specify the Metrika counter.

    line 30
  2. Distinctive:

    Check API connection and counter info.

    line 33
  3. Very specific:

    Use common.sh functions directly:

    line 204
  4. Very specific:

    Run bash scripts/quota.sh --counter THEIR_COUNTER to verify

    line 219

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

yandex-metrika

Informational skill — website traffic and user behavior analytics via Yandex Metrika API.

Config

Requires YANDEX_METRIKA_TOKEN in config/.env (synced from yandex-analytics-methodology unified config). Token setup and OAuth details in config/README.md.

Counter ID is per-project — pass it via --counter flag on every script call. Alternatively, set YANDEX_METRIKA_COUNTER in config/.env as a default for a single site.

Workflow

  1. Check connection: bash scripts/quota.sh --counter 12345678
  2. Run report using appropriate script
  3. Interpret results — the API returns raw JSON; parse and present key metrics

Scripts

All scripts accept --counter ID to specify the Metrika counter. If not passed, falls back to YANDEX_METRIKA_COUNTER from config/.env.

quota.sh

Check API connection and counter info.

bash scripts/quota.sh --counter 12345678

overview.sh

Traffic overview: visits, pageviews, users, bounce rate, avg duration.

bash scripts/overview.sh --counter 12345678 --from 2025-01-01 --to 2025-01-31
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date (YYYY-MM-DD)
--tonotodayEnd date (YYYY-MM-DD)

sources.sh

Traffic sources: search engines, referrals, direct, social.

bash scripts/sources.sh --counter 12345678 --from 2025-01-01 --to 2025-01-31 --limit 10
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date
--tonotodayEnd date
--limitno10Max rows per report

pages.sh

Popular pages: pageviews and users by URL.

bash scripts/pages.sh --counter 12345678 --from 2025-01-01 --limit 20

# Filter by URL substring
bash scripts/pages.sh --counter 12345678 --url "/price/"
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date
--tonotodayEnd date
--limitno20Max rows
--urlno-Filter pages by URL substring

devices.sh

Device, browser, and OS statistics.

bash scripts/devices.sh --counter 12345678 --type device
bash scripts/devices.sh --counter 12345678 --type browser
bash scripts/devices.sh --counter 12345678 --type os
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date
--tonotodayEnd date
--typenodevicedevice, browser, or os

goals.sh

Configured goals and conversion statistics.

# List goals only
bash scripts/goals.sh --counter 12345678 --list

# Goals with conversion stats
bash scripts/goals.sh --counter 12345678 --from 2025-01-01
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date
--tonotodayEnd date
--listnofalseOnly list goals, skip stats

visitors.sh

Visitor demographics and geography.

bash scripts/visitors.sh --counter 12345678 --type geo
bash scripts/visitors.sh --counter 12345678 --type age
bash scripts/visitors.sh --counter 12345678 --type gender
ParamRequiredDefaultDescription
--counteryes*from .envMetrika counter ID
--fromno30 days agoStart date
--tonotodayEnd date
--typenogeogeo, age, or gender

* --counter is required unless YANDEX_METRIKA_COUNTER is set in config/.env

API Reference

Stat API (reports)

  • Base: https://api-metrika.yandex.net/stat/v1/data
  • Auth: Authorization: OAuth <token>
  • Key params: id (counter), preset (report type), date1/date2, metrics, dimensions, filters, sort, limit

Presets (most useful)

PresetDescription
sources_summaryTraffic by source type
sources_search_enginesSearch engine breakdown
sources_sitesReferral sites
tech_platformsDevices (desktop/mobile/tablet)
tech_browsersBrowser stats
tech_osOS stats
geo_countryGeography by country
age_genderAge and gender
conversion_rateGoal conversions

Custom metrics (ym:s:*)

MetricDescription
ym:s:visitsVisits
ym:s:pageviewsPage views
ym:s:usersUnique users
ym:s:bounceRateBounce rate
ym:s:avgVisitDurationSecondsAvg visit duration

Custom dimensions (ym:s:*)

DimensionDescription
ym:s:TrafficSourceTraffic source
ym:s:regionCityCity
ym:s:genderGender
ym:s:ageIntervalAge group
ym:s:deviceCategoryDevice type

Page-level metrics (ym:pv:*)

Metric/DimensionDescription
ym:pv:pageviewsPage views
ym:pv:usersUsers
ym:pv:URLPathPage URL

Management API

  • Base: https://api-metrika.yandex.net/management/v1/counter/{id}/
  • Endpoints: goals, filters, operations, grants

Common use cases

"How's the site doing?"

bash scripts/overview.sh --counter 12345678
bash scripts/sources.sh --counter 12345678
bash scripts/devices.sh --counter 12345678

"Which pages get the most traffic?"

bash scripts/pages.sh --counter 12345678 --limit 30

"Are goals converting?"

bash scripts/goals.sh --counter 12345678

"Who visits the site?"

bash scripts/visitors.sh --counter 12345678 --type geo
bash scripts/visitors.sh --counter 12345678 --type age

Custom query (advanced)

Use common.sh functions directly:

source scripts/common.sh
load_config
YANDEX_METRIKA_COUNTER=12345678

# Custom metrics + dimensions
metrika_custom "ym:s:visits,ym:s:bounceRate" "ym:s:TrafficSource" "date1=2025-01-01&date2=2025-01-31&limit=10"

Sharing

To share this skill with colleagues:

  1. Copy the entire yandex-metrika/ folder to their ~/.claude/skills/
  2. They create their own config/.env with their token
  3. Run bash scripts/quota.sh --counter THEIR_COUNTER to verify

Limits

  • API rate limit: ~5 requests/second
  • Daily limit depends on token type
  • Data availability: ~5 min delay for real-time, historical data available fully

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.