Metrik ❤ ️
Yandex.Metrika + Slack = Zamphyr Metrik
You can now get reports from Yandex.Metrika to your Slack team. Choose a schedule and go. Metrik will currently generate a report for the last 7 days and beam it over to Slack.
Metrik is a Slack bot written in Meteor. The reports can be generated in a few languages. The scheduling feature supports Later.js text parsing syntax. You can add support for your language by editing private/i18n.json and sending in a pull request.
Metrik is created for Zamphyr by Marko Kažić and Zamphyr team.
Installation
- Create a bot user and obtain API token - Register a new Slack bot
- Create an Yandex app using Yandex app portal
-
The bot will try and obtain a depersonalized 2LO token from Yandex, which might not work. If it doesn't work for you, you will have to obtain an actual Yandex OAuth access token manually and save it to
YNDX_DEBUG_TOKENYandex API didn't want to collaborate, so for now I'm using a manually generated access token. - In case you are NOT using a manually obtained token, set your
YNDX_DEBUG_TOKENtofalseand make sure it's actuallyfalseboolean not"false"string. - Rename
settings.template.jsontosettings.jsonand fill with appropriate data - Set scheduling and report language
- Deploy and run Meteor using
meteor npm install && meteor --settings settings.json
Example
{
"SLACK_BOT_TOKEN": "", // Token obtained from Slack
"YNDX_CLIENT_ID": "", // Yandex app Client ID
"YNDX_CLIENT_SECRET": "", // Yandex app Client password
"YNDX_DEBUG_TOKEN": false, // Yandex debug token
"YNDX_COUNTER_ID": 12345678, // Yandex counter ID
"REPORT_TIME": "at 20:00", // Later.js text parse string
"REPORT_CHANNEL": "channelname", // Slack channel name or username to report to
"REPORT_LANG": "sr" // Language code for report (sr, ru, ua, en, ...)
}
Obtaining a debug token manually
Open your browser and navigate to https://oauth.yandex.com/authorize?response_type=token&client_id=<application ID> where you replace <application ID> with your applications Client ID as you find it on the Yandex app portal
Supported languages
- српски језик
- srpski jezik
- Русский язык
- Українська
- English
Contributing
- Pull request is better than an issue is better than a rant.
- Spread good word anywhere. Always link back to grow the community.
To-do
- i18n
- Better scheduling parse
-
Better OAuth token handling
㊙ ️ -
Goals
🏴 - Filter by date (weekly, daily)
- Better counter status report
-
Graph generation of weekly data
📈
Suggest more features!

