staccato 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +18 -2
- data/lib/staccato/adapter/faraday.rb +4 -2
- data/lib/staccato/version.rb +1 -1
- data/staccato.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78dbdd6c35573220c100fc5a549fb4e128dfb44f
|
4
|
+
data.tar.gz: 59e7828e7246c73ef99109e7dd691569a54733e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867d070de8bffaf86e818ba189961a3626cc4202fb5ddaf93a06511ccd16e58d2139370c0afeafbbc7c34a0bf9387b229a05d830dc94ce6d3fca1bb7a617a431
|
7
|
+
data.tar.gz: 91c2797dc75b3ae8a6cb6265843660969bf874d5cb0d92c1496f198e240e8a7d7e69f6abca0cb0ff53a61f8bf5f3a4ef3931cbc97017eefe48b274b37fb721d0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -78,6 +78,22 @@ tracker.transaction_item({
|
|
78
78
|
})
|
79
79
|
```
|
80
80
|
|
81
|
+
### Building Hits ###
|
82
|
+
|
83
|
+
If you need access to a hit, you can use `tracker.build_<hit type>` and pass it the same options as the above tracker methods. For example, these are all the same:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
# build and track a Staccato::Pageview in a single step
|
87
|
+
tracker.pageview(options_hash)
|
88
|
+
|
89
|
+
# build, and then track, a pageview
|
90
|
+
tracker.build_pageview(options_hash).track!
|
91
|
+
|
92
|
+
# build a Staccato::Pageview, then track it
|
93
|
+
hit = Staccato::Pageview.new(tracker, options_hash)
|
94
|
+
hit.track!
|
95
|
+
```
|
96
|
+
|
81
97
|
### "Global" Options ###
|
82
98
|
|
83
99
|
Any of the options on the parameters list (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters) that are accepted on ALL hit types can be set as options on any of the hits.
|
@@ -264,7 +280,7 @@ The combination of `product_action: 'refund'` and `transaction` measurement sett
|
|
264
280
|
```ruby
|
265
281
|
event = tracker.build_event(category: 'order', action: 'refund', non_interactive: true, product_action: 'refund')
|
266
282
|
|
267
|
-
event.add_measurement(:transaction,
|
283
|
+
event.add_measurement(:transaction, transaction_id: 'T12345')
|
268
284
|
|
269
285
|
event.track!
|
270
286
|
```
|
@@ -276,7 +292,7 @@ The combination of `product_action: 'refund'` and `transaction` measurement sett
|
|
276
292
|
```ruby
|
277
293
|
event = tracker.build_event(category: 'order', action: 'refund', non_interactive: true, product_action: 'refund')
|
278
294
|
|
279
|
-
event.add_measurement(:transaction,
|
295
|
+
event.add_measurement(:transaction, transaction_id: 'T12345')
|
280
296
|
event.add_measurement(:product, index: 1, id: 'P12345', quantity: 1)
|
281
297
|
|
282
298
|
event.track!
|
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
1
3
|
module Staccato
|
2
4
|
module Adapter
|
3
5
|
class Faraday # The Faraday Adapter
|
4
6
|
def initialize(uri)
|
5
|
-
@connection = Faraday.new(uri) do |faraday|
|
7
|
+
@connection = ::Faraday.new(uri) do |faraday|
|
6
8
|
faraday.request :url_encoded # form-encode POST params
|
7
|
-
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
9
|
+
faraday.adapter ::Faraday.default_adapter # make requests with Net::HTTP
|
8
10
|
|
9
11
|
yield faraday if block_given?
|
10
12
|
end
|
data/lib/staccato/version.rb
CHANGED
data/staccato.gemspec
CHANGED
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.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Pitale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: faraday
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Ruby Google Analytics Measurement
|
98
112
|
email:
|
99
113
|
- tpitale@gmail.com
|