Class: GoogleAnalytics::Events::SetCustomVar

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

Overview

Deprecated: Please use SetCustomDimension or SetCustomMetric instead

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, name, value, opt_scope) ⇒ SetCustomVar

Returns a new instance of SetCustomVar.

Raises:

  • (ArgumentError)


120
121
122
123
124
# File 'lib/google-analytics/events/events.rb', line 120

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)
  warn "[DEPRECATION] `SetCustomVar` is deprecated.  Please use `SetCustomDimension` or `SetCustomMetric` instead"
  super('set', "dimension#{index}", value.to_s)
end