Class: Rack::Tracker::Zanox

Inherits:
Handler
  • Object
show all
Defined in:
lib/rack/tracker/zanox/zanox.rb

Defined Under Namespace

Classes: Lead, Mastertag

Constant Summary collapse

Sale =
Class.new(Lead)

Constants included from JavaScriptHelper

JavaScriptHelper::JS_ESCAPE_MAP

Instance Attribute Summary

Attributes inherited from Handler

#env, #options

Instance Method Summary collapse

Methods inherited from Handler

#dnt_header_opt_out?, #events, #handler_name, #initialize, #inject, process_track, #render, track, #tracker_options, #write_event

Methods included from JavaScriptHelper

#escape_javascript

Constructor Details

This class inherits a constructor from Rack::Tracker::Handler

Instance Method Details

#lead_eventsObject



32
33
34
# File 'lib/rack/tracker/zanox/zanox.rb', line 32

def lead_events
  events.select{ |event| event.class.to_s.demodulize == 'Lead' }
end

#mastertagObject



26
27
28
29
30
# File 'lib/rack/tracker/zanox/zanox.rb', line 26

def mastertag
  # First event should be stronger, e.g. one signs up and gets redirected to homepage
  # "sign up" should be tracked instead of "view homepage"
  events.select{ |event| event.class.to_s.demodulize == 'Mastertag' }.first
end

#sale_eventsObject



36
37
38
# File 'lib/rack/tracker/zanox/zanox.rb', line 36

def sale_events
  events.select{ |event| event.class.to_s.demodulize == 'Sale' }
end