Module: Staccato
- Defined in:
- lib/staccato.rb,
lib/staccato/hit.rb,
lib/staccato/event.rb,
lib/staccato/social.rb,
lib/staccato/timing.rb,
lib/staccato/tracker.rb,
lib/staccato/version.rb,
lib/staccato/pageview.rb,
lib/staccato/exception.rb,
lib/staccato/option_set.rb,
lib/staccato/transaction.rb,
lib/staccato/transaction_item.rb
Overview
The ‘Staccato` module namespace
Defined Under Namespace
Modules: Hit Classes: Event, Exception, NoopTracker, OptionSet, Pageview, Social, Timing, Tracker, Transaction, TransactionItem
Constant Summary collapse
- VERSION =
The current Staccato VERSION
"0.1.1"
Class Method Summary collapse
-
.build_client_id ⇒ String
Build a new random ‘client_id`.
-
.tracker(id, client_id = nil, hit_options = {}) ⇒ Staccato::Tracker
Build a new tracker instance If the first argument is explicitly ‘nil`, a `NoopTracker` is returned which responds to all the same `tracker` methods but does no tracking.
-
.tracking_uri ⇒ Object
The tracking endpoint we use to submit requests to GA.
Class Method Details
.build_client_id ⇒ String
Build a new random ‘client_id`
31 32 33 |
# File 'lib/staccato.rb', line 31 def self.build_client_id SecureRandom.uuid end |
.tracker(id, client_id = nil, hit_options = {}) ⇒ Staccato::Tracker
Build a new tracker instance
If the first argument is explicitly `nil`, a `NoopTracker` is returned
which responds to all the same `tracker` methods but does no tracking
20 21 22 23 24 25 26 |
# File 'lib/staccato.rb', line 20 def self.tracker(id, client_id = nil, = {}) if id.nil? Staccato::NoopTracker.new else Staccato::Tracker.new(id, client_id, ) end end |
.tracking_uri ⇒ Object
The tracking endpoint we use to submit requests to GA
36 37 38 |
# File 'lib/staccato.rb', line 36 def self.tracking_uri URI('http://www.google-analytics.com/collect') end |