Module: GaCollect::Measure
- Defined in:
- lib/ga_collect/measure/item.rb,
lib/ga_collect/measure/event.rb,
lib/ga_collect/measure/social.rb,
lib/ga_collect/measure/timing.rb,
lib/ga_collect/measure/pageview.rb,
lib/ga_collect/measure/exception.rb,
lib/ga_collect/measure/screenview.rb,
lib/ga_collect/measure/transaction.rb
Class Method Summary collapse
- .event(options = {}) ⇒ Object
- .exception(options = {}) ⇒ Object
- .item(options = {}) ⇒ Object
- .pageview(options = {}) ⇒ Object
- .screenview(options = {}) ⇒ Object
- .social(options = {}) ⇒ Object
- .timing(options = {}) ⇒ Object
- .transaction(options = {}) ⇒ Object
Class Method Details
.event(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/ga_collect/measure/event.rb', line 5 def self.event(={}) raise ArgumentError, 'category is required' if [:ec].nil? || [:ec].empty? raise ArgumentError, 'action is required' if [:ea].nil? || [:ea].empty? params = {ec: '', ea: '', el: '', ev: ''}.merge() GaCollect::HTTP.get(params) end |
.exception(options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/ga_collect/measure/exception.rb', line 5 def self.exception(={}) params = {exd: '', exf: ''}.merge() GaCollect::HTTP.get(params) end |
.item(options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/ga_collect/measure/item.rb', line 5 def self.item(={}) raise ArgumentError, 'transaction_id is required' if [:ti].nil? || [:ti].to_s.empty? params = {ti: '', in: '', ip: 0, iq: 1, ic: '', iv: '', cu: 'EUR'}.merge() GaCollect::HTTP.get(params) end |
.pageview(options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/ga_collect/measure/pageview.rb', line 5 def self.pageview(={}) params = {dh: '', dp: '', dt: ''}.merge() GaCollect::HTTP.get(params) end |
.screenview(options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/ga_collect/measure/screenview.rb', line 5 def self.screenview(={}) params = {an: '', av: '', aid: '', aiid: '', cd: ''}.merge() GaCollect::HTTP.get(params) end |
.social(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/ga_collect/measure/social.rb', line 5 def self.(={}) raise ArgumentError, 'social_action is required' if [:sa].nil? || [:sa].empty? raise ArgumentError, 'social_network is required' if [:sn].nil? || [:sn].empty? raise ArgumentError, 'social_target is required' if [:st].nil? || [:st].empty? params = {sa: '', sn: '', st: ''}.merge() GaCollect::HTTP.get(params) end |
.timing(options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/ga_collect/measure/timing.rb', line 5 def self.timing(={}) params = {utc: '', utv: '', utt: 0, utl: '', dns: 0, pdt: 0, rrt: 0, tcp: 0, srt: 0}.merge() GaCollect::HTTP.get(params) end |
.transaction(options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/ga_collect/measure/transaction.rb', line 5 def self.transaction(={}) raise ArgumentError, 'transaction_id is required' if [:ti].nil? || [:ti].to_s.empty? params = {ti: '', ta: '', tr: 0, ts: 0, tt: 0, cu: 'EUR'}.merge() GaCollect::HTTP.get(params) end |