module GoogleAnalytics::InstanceMethods

Protected Instance Methods

ga_push(*attributes) click to toggle source
# File lib/google-analytics/instance_methods.rb, line 31
def ga_push(*attributes)
  var = GoogleAnalytics::Push.new(attributes)
  ga_events.push(var)
end
ga_track_event(category, action, label = nil, value = nil) click to toggle source

Tracks an event or goal on a page load

e.g. writes ga.(‘send’, ‘event’, ‘Videos’, ‘Play’, ‘Gone With the Wind’);

# File lib/google-analytics/instance_methods.rb, line 27
def ga_track_event(category, action, label = nil, value = nil)
  ga_events.push(GoogleAnalytics::Event.new(category, action, label, value))
end

Private Instance Methods

ga_custom_vars() click to toggle source
# File lib/google-analytics/instance_methods.rb, line 12
def ga_custom_vars
  self.env["google_analytics.custom_vars"] ||= []
end
ga_events() click to toggle source
# File lib/google-analytics/instance_methods.rb, line 16
def ga_events
  self.env["google_analytics.event_tracking"] ||= []
end