Class: GoogleAnalytics::Events::SetCustomVar

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

Instance Attribute Summary

Attributes inherited from GoogleAnalytics::Event

#name, #params

Instance Method Summary collapse

Constructor Details

#initialize(index, name, value, opt_scope) ⇒ SetCustomVar

Returns a new instance of SetCustomVar.

Raises:

  • (ArgumentError)


57
58
59
60
# File 'lib/google-analytics/events/events.rb', line 57

def initialize(index, name, value, opt_scope)
  raise ArgumentError, "The index has to be between 1 and 5" unless (1..5).include?(index.to_i)
  super('_setCustomVar', index.to_i, name.to_s, value.to_s, opt_scope.to_i)
end