Class: GoogleAnalytics::Events::TrackEvent

Inherits:
GoogleAnalytics::Event show all
Defined in:
lib/google-analytics/events/events.rb

Instance Attribute Summary

Attributes inherited from GoogleAnalytics::Event

#action, #name, #params

Instance Method Summary collapse

Methods inherited from GoogleAnalytics::Event

#single_event?

Constructor Details

#initialize(category, action, label = nil, value = nil) ⇒ TrackEvent

Returns a new instance of TrackEvent.



90
91
92
93
94
95
96
# File 'lib/google-analytics/events/events.rb', line 90

def initialize(category, action, label = nil, value = nil)
  if label || value
    super('send', 'event', category.to_s, action.to_s, label ? label.to_s : nil, value ? value.to_i : nil)
  else
    super('send', 'event', category.to_s, action.to_s)
  end
end