YaMetrika
Ruby gem for API Yandex Metrika
Installation
Add this line to your application's Gemfile:
gem 'ya_metrika'And then execute:
$ bundleOr install it yourself as:
$ gem install ya_metrikaUsage
require 'ya_metrika'
# Set config params or set its as a hash of options in constructor of YaMetrika::Client
# YaMetrika::Client.new(oauth_token: '05dd3dd84ff948fdae2bc4fb91f13e22')
# Default format is json
YaMetrika::Settings[:format] = :json # or :xml
YaMetrika::Settings[:oauth_token] = '05dd3dd84ff948fdae2bc4fb91f13e22'
client = YaMetrika::Client.new
response = client.counter(2215573).goal(334423).get
response = client.stat.traffic.summary.get(id: 2138128)
# OR
client.stat
client.traffic
client.summary
response = client.get(id: 2138128)Contributing
- Fork it ( https://github.com/shved270189/ya_metrika )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request