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
In this repository48 other files it gives its agents.
- skills/dev-methodology/references/agents.mdAGENTS.md
- skills/skill-authoring/references/agents.mdAGENTS.md
- acceptance-protocolSkill
- agency-intakeSkill
- ai-visibility-methodologySkill
- banner-design-guideSkill
- benchmark-researchSkill
- brand-methodologySkill
- code-reviewingSkill
- code-writingSkill
- codex-bridgeSkill
- deploy-pipelineSkill
- design-assets-guideSkill
- design-system-methodologySkill
- design-task-decompositionSkill
- dev-methodologySkill
- docs-pipelineSkill
- documentation-writingSkill
- engagement-contractSkill
- engagement-protocolSkill
- feature-researchSkill
- human-voiceSkill
- infrastructure-setupSkill
- marketing-task-decompositionSkill
- post-deploy-qaSkill
- pre-deploy-qaSkill
- presentation-designSkill
- project-planningSkill
- prompt-engineeringSkill
- security-auditingSkill
- semantic-drift-methodologySkill
- seo-auditingSkill
- skill-authoringSkill
- skill-test-designSkill
- skill-testingSkill
- system-optimization-protocolSkill
- task-decompositionSkill
- tech-spec-planningSkill
- testing-methodologySkill
- ui-styling-guideSkill
- ui-ux-methodologySkill
- user-spec-planningSkill
- validation-pipelineSkill
- yandex-analytics-methodologySkill
- yandex-direct-guideSkill
- yandex-search-guideSkill
- yandex-webmaster-guideSkill
- yandex-wordstat-guideSkill
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
- Very specific: line 30
All scripts accept --counter ID to specify the Metrika counter.
- Distinctive: line 33
Check API connection and counter info.
- Very specific: line 204
Use common.sh functions directly:
- Very specific: line 219
Run bash scripts/quota.sh --counter THEIR_COUNTER to verify
≈ “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.
Files
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
- Check connection:
bash scripts/quota.sh --counter 12345678 - Run report using appropriate script
- 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 12345678overview.sh
Traffic overview: visits, pageviews, users, bounce rate, avg duration.
bash scripts/overview.sh --counter 12345678 --from 2025-01-01 --to 2025-01-31| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date (YYYY-MM-DD) |
--to | no | today | End 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| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date |
--to | no | today | End date |
--limit | no | 10 | Max 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/"| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date |
--to | no | today | End date |
--limit | no | 20 | Max rows |
--url | no | - | 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| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date |
--to | no | today | End date |
--type | no | device | device, 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| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date |
--to | no | today | End date |
--list | no | false | Only 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| Param | Required | Default | Description |
--counter | yes* | from .env | Metrika counter ID |
--from | no | 30 days ago | Start date |
--to | no | today | End date |
--type | no | geo | geo, 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)
| Preset | Description |
sources_summary | Traffic by source type |
sources_search_engines | Search engine breakdown |
sources_sites | Referral sites |
tech_platforms | Devices (desktop/mobile/tablet) |
tech_browsers | Browser stats |
tech_os | OS stats |
geo_country | Geography by country |
age_gender | Age and gender |
conversion_rate | Goal conversions |
Custom metrics (ym:s:*)
| Metric | Description |
ym:s:visits | Visits |
ym:s:pageviews | Page views |
ym:s:users | Unique users |
ym:s:bounceRate | Bounce rate |
ym:s:avgVisitDurationSeconds | Avg visit duration |
Custom dimensions (ym:s:*)
| Dimension | Description |
ym:s:TrafficSource | Traffic source |
ym:s:regionCity | City |
ym:s:gender | Gender |
ym:s:ageInterval | Age group |
ym:s:deviceCategory | Device type |
Page-level metrics (ym:pv:*)
| Metric/Dimension | Description |
ym:pv:pageviews | Page views |
ym:pv:users | Users |
ym:pv:URLPath | Page 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 ageCustom 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:
- Copy the entire
yandex-metrika/folder to their~/.claude/skills/ - They create their own
config/.envwith their token - Run
bash scripts/quota.sh --counter THEIR_COUNTERto 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
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
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.

