Class: Staccato::NoopTracker
- Inherits:
-
Object
- Object
- Staccato::NoopTracker
- Defined in:
- lib/staccato/tracker.rb
Overview
A tracker which does no tracking
Useful in testing
Instance Method Summary collapse
-
#build_event(options = {}) ⇒ Event
Build an event.
-
#build_pageview(options = {}) ⇒ Pageview
Build a pageview.
-
#client_id ⇒ String
The unique client id.
-
#event(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an event.
-
#exception(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an exception.
-
#hit_defaults ⇒ Hash
hit defaults for our noop.
-
#id ⇒ String?
The tracker id for GA.
-
#initialize(id = nil, client_id = nil, hit_defaults = {}) ⇒ NoopTracker
constructor
sets up a new tracker.
-
#pageview(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a pageview.
-
#social(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a social event such as a Facebook Like or Twitter Share.
-
#timing(options = {}, &block) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track timing.
-
#track(params = {}) ⇒ Net::HTTPOK
post the hit to GA collection endpoint.
-
#transaction(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an ecommerce transaction.
-
#transaction_item(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an item in an ecommerce transaction.
Constructor Details
#initialize(id = nil, client_id = nil, hit_defaults = {}) ⇒ NoopTracker
sets up a new tracker
150 |
# File 'lib/staccato/tracker.rb', line 150 def initialize(id = nil, client_id = nil, hit_defaults = {}); end |
Instance Method Details
#build_event(options = {}) ⇒ Event
Build an event
173 |
# File 'lib/staccato/tracker.rb', line 173 def build_event( = {}); end |
#build_pageview(options = {}) ⇒ Pageview
Build a pageview
169 |
# File 'lib/staccato/tracker.rb', line 169 def build_pageview( = {}); end |
#client_id ⇒ String
The unique client id
164 165 166 |
# File 'lib/staccato/tracker.rb', line 164 def client_id nil end |
#event(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an event
175 |
# File 'lib/staccato/tracker.rb', line 175 def event( = {}); end |
#exception(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an exception
179 |
# File 'lib/staccato/tracker.rb', line 179 def exception( = {}); end |
#hit_defaults ⇒ Hash
hit defaults for our noop
154 155 156 |
# File 'lib/staccato/tracker.rb', line 154 def hit_defaults {} end |
#id ⇒ String?
The tracker id for GA
159 160 161 |
# File 'lib/staccato/tracker.rb', line 159 def id nil end |
#pageview(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a pageview
171 |
# File 'lib/staccato/tracker.rb', line 171 def pageview( = {}); end |
#social(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a social event such as a Facebook Like or Twitter Share
177 |
# File 'lib/staccato/tracker.rb', line 177 def ( = {}); end |
#timing(options = {}, &block) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track timing
181 182 183 |
# File 'lib/staccato/tracker.rb', line 181 def timing( = {}, &block) yield if block_given? end |
#track(params = {}) ⇒ Net::HTTPOK
post the hit to GA collection endpoint
192 193 |
# File 'lib/staccato/tracker.rb', line 192 def track(params = {}) end |
#transaction(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an ecommerce transaction
185 186 |
# File 'lib/staccato/tracker.rb', line 185 def transaction( = {}) end |
#transaction_item(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an item in an ecommerce transaction
188 189 |
# File 'lib/staccato/tracker.rb', line 188 def transaction_item( = {}) end |