Class: GAQ::Events::TrackEvent

Inherits:
GAQ::Event show all
Defined in:
lib/google_analytics_tools/tracking/events/events.rb

Instance Attribute Summary

Attributes inherited from GAQ::Event

#name, #params

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TrackEvent.


29
30
31
32
33
34
35
36
37
38
39
# File 'lib/google_analytics_tools/tracking/events/events.rb', line 29

def initialize(category, action, label = nil, value = nil)
  if label && value
    super('_trackEvent', category.to_s, action.to_s, label, value)
  elsif label
    super('_trackEvent', category.to_s, action.to_s, label)
  elsif value
    super('_trackEvent', category.to_s, action.to_s, nil, value)
  else
    super('_trackEvent', category.to_s, action.to_s)
  end
end