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
177 |
# File 'lib/staccato/tracker.rb', line 177 def initialize(id = nil, client_id = nil, hit_defaults = {}); end |
Instance Method Details
#build_event(options = {}) ⇒ Event
Build an event
200 |
# File 'lib/staccato/tracker.rb', line 200 def build_event( = {}); end |
#build_pageview(options = {}) ⇒ Pageview
Build a pageview
196 |
# File 'lib/staccato/tracker.rb', line 196 def build_pageview( = {}); end |
#client_id ⇒ String
The unique client id
191 192 193 |
# File 'lib/staccato/tracker.rb', line 191 def client_id nil end |
#event(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an event
202 |
# File 'lib/staccato/tracker.rb', line 202 def event( = {}); end |
#exception(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an exception
206 |
# File 'lib/staccato/tracker.rb', line 206 def exception( = {}); end |
#hit_defaults ⇒ Hash
hit defaults for our noop
181 182 183 |
# File 'lib/staccato/tracker.rb', line 181 def hit_defaults {} end |
#id ⇒ String?
The tracker id for GA
186 187 188 |
# File 'lib/staccato/tracker.rb', line 186 def id nil end |
#pageview(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a pageview
198 |
# File 'lib/staccato/tracker.rb', line 198 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
204 |
# File 'lib/staccato/tracker.rb', line 204 def ( = {}); end |
#timing(options = {}, &block) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track timing
208 209 210 |
# File 'lib/staccato/tracker.rb', line 208 def timing( = {}, &block) yield if block_given? end |
#track(params = {}) ⇒ Net::HTTPOK
post the hit to GA collection endpoint
219 220 |
# File 'lib/staccato/tracker.rb', line 219 def track(params = {}) end |
#transaction(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an ecommerce transaction
212 213 |
# File 'lib/staccato/tracker.rb', line 212 def transaction( = {}) end |
#transaction_item(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an item in an ecommerce transaction
215 216 |
# File 'lib/staccato/tracker.rb', line 215 def transaction_item( = {}) end |