Class: GoogleAnalytics::CustomVar

Inherits:
Struct
  • Object
show all
Defined in:
lib/tracking/custom_var.rb

Overview

A Struct that mirrors the structure of a custom var defined in Google Analytics see developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables

Constant Summary collapse

VISITOR_LEVEL =
1
SESSION_LEVEL =
2
PAGE_LEVEL =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



5
6
7
# File 'lib/tracking/custom_var.rb', line 5

def index
  @index
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/tracking/custom_var.rb', line 5

def name
  @name
end

#opt_scopeObject

Returns the value of attribute opt_scope

Returns:

  • (Object)

    the current value of opt_scope



5
6
7
# File 'lib/tracking/custom_var.rb', line 5

def opt_scope
  @opt_scope
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



5
6
7
# File 'lib/tracking/custom_var.rb', line 5

def value
  @value
end

Instance Method Details

#writeObject



10
11
12
# File 'lib/tracking/custom_var.rb', line 10

def write
  ['_setCustomVar', self.index, self.name, self.value,self.opt_scope].to_json
end