Class: GoogleAnalytics::Events::TrackPageview
- Inherits:
-
GoogleAnalytics::Event
- Object
- GoogleAnalytics::Event
- GoogleAnalytics::Events::TrackPageview
- Defined in:
- lib/google-analytics/events/events.rb
Overview
Instance Attribute Summary
Attributes inherited from GoogleAnalytics::Event
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TrackPageview
constructor
A new instance of TrackPageview.
Methods inherited from GoogleAnalytics::Event
Constructor Details
#initialize(opts = {}) ⇒ TrackPageview
Returns a new instance of TrackPageview.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/google-analytics/events/events.rb', line 75 def initialize(opts = {}) # Just use default pageview if no page was given if opts.is_a?(Hash) && opts.fetch(:page, nil) == nil super('send', 'pageview') # Provide only the page string if a title was not given but a page was elsif opts.is_a?(Hash) && opts.fetch(:page, false) super('send', 'pageview', opts.fetch(:title, false) ? opts : opts[:page]) # Print out a JSON Value for the pageview else super('send', 'pageview', opts) end end |