Project

ya_metrika

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby gem for API Yandex Metrika
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
~> 0

Runtime

 Project Readme

YaMetrika

Gem Version

Ruby gem for API Yandex Metrika

Installation

Add this line to your application's Gemfile:

gem 'ya_metrika'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ya_metrika

Usage

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

  1. Fork it ( https://github.com/shved270189/ya_metrika )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request