Class: GoogleAnalytics::Event
- Inherits:
-
Struct
- Object
- Struct
- GoogleAnalytics::Event
- Defined in:
- lib/tracking/event.rb
Overview
A Struct that mirrors the structure of a custom var defined in Google Analytics see developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#category ⇒ Object
Returns the value of attribute category.
-
#label ⇒ Object
Returns the value of attribute label.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
8 9 10 |
# File 'lib/tracking/event.rb', line 8 def action @action end |
#category ⇒ Object
Returns the value of attribute category
8 9 10 |
# File 'lib/tracking/event.rb', line 8 def category @category end |
#label ⇒ Object
Returns the value of attribute label
8 9 10 |
# File 'lib/tracking/event.rb', line 8 def label @label end |
#value ⇒ Object
Returns the value of attribute value
8 9 10 |
# File 'lib/tracking/event.rb', line 8 def value @value end |
Instance Method Details
#write ⇒ Object
10 11 12 |
# File 'lib/tracking/event.rb', line 10 def write { hitType: 'event', eventCategory: self.category, eventAction: self.action, eventLabel: self.label, eventValue: self.value }.select{|k,v| v }.to_json end |