Class: Staccato::NoopTracker

Inherits:
Object
  • Object
show all
Defined in:
lib/staccato/tracker.rb

Overview

A tracker which does no tracking

Useful in testing

Instance Attribute Summary collapse

Instance Method Summary collapse

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_defaultsObject

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_adapterObject



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(options = {}); end

#build_pageview(options = {}) ⇒ Pageview

Build a pageview



236
# File 'lib/staccato/tracker.rb', line 236

def build_pageview(options = {}); end

#client_idString

The unique client id



231
232
233
# File 'lib/staccato/tracker.rb', line 231

def client_id
  nil
end

#default_uriObject



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(options = {}); 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(options = {}); end

#idString?

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(options = {}); 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 social(options = {}); 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(options = {}, &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(options = {})
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(options = {})
end