# LazyGoogleAnalytics Lazy google analytics for the lazy programmer. it´s an abstraction around google-analytics-client gem. ## Motivation google-analytics-client gem is a very powerfull tool to access the api resources on google. but for me it was not very straightforward , so i come around with a simple way to implement it. thats all. Hope you like it. ## Installation Add this line to your application's Gemfile: gem 'lazy_google_analytics' And then execute: $ bundle Or install it yourself as: $ gem install lazy_google_analytics ## Simple Usage config_options = pass_phrase: "notasecret", key_file: /location/to_your/key_file.p12, client_id: "XXXXX.apps.googleusercontent.com", scope: "https://www.googleapis.com/auth/analytics.readonly", profile_id: "XXXXX", email: "XXXXXX@developer.gserviceaccount.com" @config = LazyGoogleAnalytics::Config.new(config_options) @auth = LazyGoogleAnalytics::Auth.new(@config) @auth.authorize @client = LazyGoogleAnalytics::Client.new({:config=>@config, :auth=>@auth, :client_options => {} }) ## GA How to: If you follow this simple steps , you can´t fail. + First, you have to register your api access in: [google api console](https://code.google.com/apis/console/) and create a server key. + Download the p12 key. + Add the created @developer.gserviceaccount.com to your users list in the analytics user panel. + Configure options based on server key and analytics profile id, not the (UA-something) account id! ## Contributing 1. Fork it 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 new Pull Request ### TODO + Needs some refactor on client options. + Needs more specs on client options. + Config Generators for ruby on rails for the laziest ones.