Metrik

Metrik

Metrik is a Slack bot that reports on your Yandex.Metrika metrics on schedule

Name Last Update
.meteor Loading commit data...
private Loading commit data...
server Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
README.md Loading commit data...
package.json Loading commit data...
settings.template.json Loading commit data...

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

  1. Create a bot user and obtain API token - Register a new Slack bot
  2. Create an Yandex app using Yandex app portal
  3. 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_TOKEN Yandex API didn't want to collaborate, so for now I'm using a manually generated access token.
  4. In case you are NOT using a manually obtained token, set your YNDX_DEBUG_TOKEN to false and make sure it's actually false boolean not "false" string.
  5. Rename settings.template.json to settings.json and fill with appropriate data
  6. Set scheduling and report language
  7. 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!

Screenshots

Slack report Report