Search by

tikhomirov / moonshine-yandex-metrika

tikhomirov

Yandex Metrika + Webmaster analytics dashboard for MoonShine 5.x

Package info

github.com/tikhomirov/moonshine-yandex-metrika

pkg:composer/tikhomirov/moonshine-yandex-metrika

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.0-beta.1 2026-11-15 15:16 UTC

This package is auto-updated.

Last update: 2026-11-15 20:29:53 UTC


README

Yandex Metrika and Webmaster analytics inside MoonShine
Traffic, search queries, and indexing status — in one dashboard.

Русская версия

MoonShine Yandex Metrika

Packagist version PHP 8.4+ MoonShine 5.x Tests

MoonShine dashboard with Yandex Metrika and Webmaster tabs, period filters, KPI cards, and a visits chart

Features

  • Yandex Metrika: visits, page views, unique visitors, bounce rate, daily chart, and top pages.
  • Yandex Webmaster: indexing summary, site issues, external links, and popular search queries.
  • Flexible periods: presets and custom date ranges.
  • CSV exports for Metrika statistics and Webmaster queries.
  • Yandex account information and API response caching.
  • An extensible tab registry for adding third-party analytics without forking the package.
  • Russian and English UI translations.

Requirements

Component Version
PHP 8.4+
Laravel 12 or 13
MoonShine 5.x

Installation

composer require tikhomirov/moonshine-yandex-metrika
php artisan vendor:publish --tag=moonshine-yandex-metrika-config

Register the page in your MoonShine menu and add it to the custom pages for your layout/provider:

use Tikhomirov\MoonshineYandexMetrika\Pages\MetrikaDashboardPage;

MenuItem::make(MetrikaDashboardPage::class, 'Yandex Metrika');

Yandex setup

Create an application at Yandex OAuth, set the redirect URI to https://oauth.yandex.ru/verification_code, and grant the scopes you need:

Scope Purpose
metrika:read Metrika statistics
webmaster:verify Webmaster indexing and search queries
webmaster:hostinfo Host details and external links
login:info, login:email, login:avatar Yandex account email and avatar

Add your settings to .env:

YANDEX_METRIKA_TOKEN=your_oauth_token
YANDEX_METRIKA_COUNTER_ID=your_counter_id
YANDEX_METRIKA_DEFAULT_PRESET=today
YANDEX_WEBMASTER_HOST_ID=https:example.com:443

YANDEX_WEBMASTER_HOST_ID is required for Webmaster and must use the host format shown in Yandex Webmaster. Metrika keeps working without it.

Periods and exports

Available presets: today, yesterday, week, month, quarter, half year, and year, plus a custom date range. The Webmaster summary shows the site's current state; the selected period applies to search queries.

CSV export routes are available to authenticated MoonShine administrators:

  • /admin/yandex-analytics/export/metrika
  • /admin/yandex-analytics/export/webmaster

AI agent skill

This package includes a ready-to-use AI agent skill for configuring, extending, and troubleshooting the dashboard. It is intentionally shipped in the Composer distribution at vendor/tikhomirov/moonshine-yandex-metrika/skills/moonshine-yandex-metrika/SKILL.md.

Install llm/skills in the host application to discover the skill from Composer dependencies and sync it into your agent's skills directory:

composer require --dev llm/skills
composer skills:init --quick
composer skills:show

The skill package auto-discovers SKILL.md files in Composer dependencies by default. Keeping this package's skills/ directory in its distribution makes the dashboard instructions available to coding agents in the consuming application.

Localization

The dashboard ships with English and Russian translations and follows the Laravel application's locale. To publish the translation files for customization:

php artisan vendor:publish --tag=moonshine-yandex-metrika-lang

More information

License

MIT. See LICENSE.