staccato 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e9fb805954cebe8f6334573603ad141a54a0799
4
- data.tar.gz: 40489db42cf2874a45a22ada4232d2c84b618ac9
3
+ metadata.gz: a69dc443e3cf0db9064a59a292c15d06d1a7cdc8
4
+ data.tar.gz: 972bfd289296b857df802c4435d290f0900cc5a4
5
5
  SHA512:
6
- metadata.gz: d606349f6b90ffa8e2c96c072f3549311daf437c74ad6b97216c3d720ca0c384cc0850c32862817a49b751e88b79250a986ba02f641cdf305576ea0de0df130b
7
- data.tar.gz: 5d1d3ccc1000191700ee1b3559fa5db18e24c60b4098f5633bb8851444275827584e1e1dfe692c78573a70cff22a0ec2b047b08ae6934d1eb5de22de4ea70a51
6
+ metadata.gz: 0f1415a7a402b8dc46005161f289b1b6e07c59e81362095b300a738d0c0a83fd932623b42966b2457e31ff55daa589a4db04aff2cf17077233238137444ccb10
7
+ data.tar.gz: d3f447d6fe02bdc9926ac8c5ecc37c792d3acd965a9e962b6892a95d506c897835446c13f5c92929e80e1c3f9321f6a1cdae8657deaf374eebb9feea37be8a92
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## Staccato 0.4.3 ##
2
+
3
+ * Adds `data_source` as global option
4
+
5
+ *Matt Thomson <@matt-thomson>*
6
+
1
7
  ## Staccato 0.4.2 ##
2
8
 
3
9
  * Logger adapter for development
data/README.md CHANGED
@@ -103,6 +103,7 @@ Staccato::Hit::GLOBAL_OPTIONS.keys # =>
103
103
 
104
104
  [:anonymize_ip,
105
105
  :queue_time,
106
+ :data_source,
106
107
  :cache_buster,
107
108
  :user_id,
108
109
  :user_ip,
@@ -142,6 +143,8 @@ Staccato::Hit::GLOBAL_OPTIONS.keys # =>
142
143
 
143
144
  Boolean options like `anonymize_ip` will be converted from `true`/`false` into `1`/`0` as per the tracking API docs.
144
145
 
146
+ The `data_source` option can take any value, but note that hits sent from other Google tools will have specific values. Hits sent from analytics.js will have `data_source` set to `web`, and hits sent from one of the mobile SDKs will have `data_source` set to `app`.
147
+
145
148
  #### Custom Dimensions and Metrics ####
146
149
 
147
150
  ```ruby
@@ -415,6 +418,7 @@ pageview.track!
415
418
  tracker.screenview({
416
419
  screen_name: 'user1'
417
420
  })
421
+ ```
418
422
 
419
423
  ## Google Documentation ##
420
424
 
@@ -422,13 +426,19 @@ https://developers.google.com/analytics/devguides/collection/protocol/v1/devguid
422
426
  https://developers.google.com/analytics/devguides/collection/protocol/v1/reference
423
427
  https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
424
428
 
425
- ## HTTP Adapters ##
429
+ ## Adapters ##
430
+
431
+ Staccato provides a variety of adapters for sending or debugging requests being made. To use them, first require the adapter by name: `require 'staccato/adapter/#{chosen-adapter-name}'`
432
+
433
+ ### HTTP Adapters ###
426
434
 
427
435
  Staccato provides a number of basic adapters to different ruby http libraries. By default, Staccato uses `net/http` when you create a new tracker. If you are using Faraday or [The Ruby HTTP library](https://github.com/httprb/http.rb) Staccato provides adapters.
428
436
 
429
437
  ```ruby
438
+ require 'staccato/adapter/faraday' # Faraday gem must be installed
439
+
430
440
  tracker = Staccato.tracker('UA-XXXX-Y') do |c|
431
- c.adapter = Staccato::Adapter::Faraday.new(Stacatto.ga_collection_uri) do |faraday|
441
+ c.adapter = Staccato::Adapter::Faraday.new(Staccato.ga_collection_uri) do |faraday|
432
442
  # further faraday configuration here
433
443
  end
434
444
  end
@@ -470,7 +480,7 @@ Which would be used like:
470
480
 
471
481
  ```ruby
472
482
  tracker = Staccato.tracker('UA-XXXX-Y') do |c|
473
- c.adapter = CustomAdapter.new(Stacatto.ga_collection_uri, read_timeout: 1, open_time: 1)
483
+ c.adapter = CustomAdapter.new(Staccato.ga_collection_uri, read_timeout: 1, open_time: 1)
474
484
  end
475
485
  ```
476
486
 
@@ -479,6 +489,8 @@ end
479
489
  The validation adapter sends hits to the debug endpoint, which responds with information about the validity of the hit.
480
490
 
481
491
  ```ruby
492
+ require 'staccato/adapter/validate'
493
+
482
494
  tracker = Staccato.tracker('UA-XXXX-Y') do |c|
483
495
  c.adapter = Staccato::Adapter::Validate.new
484
496
  end
@@ -497,6 +509,8 @@ end
497
509
  If you're using [Staccato::Proxy](https://github.com/tpitale/staccato-proxy), you can point Staccato at it using the UDP adapter.
498
510
 
499
511
  ```ruby
512
+ require 'staccato/adapter/udp'
513
+
500
514
  tracker = Staccato.tracker('UA-XXXX-Y') do |c|
501
515
  c.adapter = Staccato::Adapter::UDP.new(URI('udp://127.0.0.1:3003'))
502
516
  end
@@ -509,8 +523,10 @@ Be sure to set the ip or host and port to wherever you have configured Staccato:
509
523
  If you're running in development and simply want to make sure Staccato is being called where you expect it to be. Or, if you want to compare the parameters staccato sends with the Google Analytics documentation.
510
524
 
511
525
  ```ruby
526
+ require 'staccato/adapter/logger'
527
+
512
528
  tracker = Staccato.tracker('UA-XXXX-Y') do |c|
513
- c.adapter = Staccato::Adapter::Logger.new(Stacatto.ga_collection_uri, Logger.new(STDOUT), lambda {|params| JSON.dump(params)})
529
+ c.adapter = Staccato::Adapter::Logger.new(Staccato.ga_collection_uri, Logger.new(STDOUT), lambda {|params| JSON.dump(params)})
514
530
  end
515
531
  ```
516
532
 
data/lib/staccato/hit.rb CHANGED
@@ -22,6 +22,7 @@ module Staccato
22
22
  GLOBAL_OPTIONS = {
23
23
  anonymize_ip: 'aip', # boolean
24
24
  queue_time: 'qt', # integer
25
+ data_source: 'ds',
25
26
  cache_buster: 'z',
26
27
  user_id: 'uid', # a known user's id
27
28
 
@@ -1,4 +1,4 @@
1
1
  module Staccato
2
2
  # The current Staccato VERSION
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staccato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-15 00:00:00.000000000 Z
11
+ date: 2015-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler