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 Attribute Summary collapse
-
#hit_defaults ⇒ Object
Returns the value of attribute hit_defaults.
Instance Method Summary collapse
- #adapter= ⇒ Object
- #add_adapter ⇒ Object
-
#build_event(options = {}) ⇒ Event
Build an event.
-
#build_pageview(options = {}) ⇒ Pageview
Build a pageview.
-
#client_id ⇒ String
The unique client id.
- #default_uri ⇒ Object
-
#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.
-
#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
213 214 215 |
# File 'lib/staccato/tracker.rb', line 213 def initialize(id = nil, client_id = nil, hit_defaults = {}) self.hit_defaults = hit_defaults end |
Instance Attribute Details
#hit_defaults ⇒ Object
Returns the value of attribute hit_defaults.
210 211 212 |
# File 'lib/staccato/tracker.rb', line 210 def hit_defaults @hit_defaults end |
Instance Method Details
#adapter= ⇒ Object
217 218 219 |
# File 'lib/staccato/tracker.rb', line 217 def adapter=(*) [] end |
#add_adapter ⇒ Object
221 222 223 |
# File 'lib/staccato/tracker.rb', line 221 def add_adapter(*) [] end |
#build_event(options = {}) ⇒ Event
Build an event
240 |
# File 'lib/staccato/tracker.rb', line 240 def build_event( = {}); end |
#build_pageview(options = {}) ⇒ Pageview
Build a pageview
236 |
# File 'lib/staccato/tracker.rb', line 236 def build_pageview( = {}); end |
#client_id ⇒ String
The unique client id
231 232 233 |
# File 'lib/staccato/tracker.rb', line 231 def client_id nil end |
#default_uri ⇒ Object
262 263 264 |
# File 'lib/staccato/tracker.rb', line 262 def default_uri Staccato.ga_collection_uri end |
#event(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an event
242 |
# File 'lib/staccato/tracker.rb', line 242 def event( = {}); end |
#exception(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an exception
246 |
# File 'lib/staccato/tracker.rb', line 246 def exception( = {}); end |
#id ⇒ String?
The tracker id for GA
226 227 228 |
# File 'lib/staccato/tracker.rb', line 226 def id nil end |
#pageview(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track a pageview
238 |
# File 'lib/staccato/tracker.rb', line 238 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
244 |
# File 'lib/staccato/tracker.rb', line 244 def ( = {}); end |
#timing(options = {}, &block) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track timing
248 249 250 |
# File 'lib/staccato/tracker.rb', line 248 def timing( = {}, &block) yield if block_given? end |
#track(params = {}) ⇒ Net::HTTPOK
post the hit to GA collection endpoint
259 260 |
# File 'lib/staccato/tracker.rb', line 259 def track(params = {}) end |
#transaction(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an ecommerce transaction
252 253 |
# File 'lib/staccato/tracker.rb', line 252 def transaction( = {}) end |
#transaction_item(options = {}) ⇒ <Net::HTTPOK] the GA `/collect` endpoint always returns a 200
Track an item in an ecommerce transaction
255 256 |
# File 'lib/staccato/tracker.rb', line 255 def transaction_item( = {}) end |