Class: GoogleAnalytics::Events::SetCustomDimension

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(index, value) ⇒ SetCustomDimension

Returns a new instance of SetCustomDimension.

Raises:

  • (ArgumentError)


128
129
130
131
# File 'lib/google-analytics/events/events.rb', line 128

def initialize(index, value)
  raise ArgumentError, "The index has to be between 1 and #{GA.max_custom_indices}" unless (1..GA.max_custom_indices).include?(index.to_i)
  super('set', "dimension#{index}", value.to_s)
end