ga-measurements 0.0.2 → 0.0.3
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.
- data/lib/ga-measurements.rb +8 -3
- metadata +2 -2
data/lib/ga-measurements.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'uuid'
|
1
|
+
require 'httparty'
|
2
|
+
require 'uuid'
|
4
3
|
|
4
|
+
class GAMeasurements
|
5
5
|
include HTTParty
|
6
6
|
|
7
7
|
TYPES = %w(pageview event item transaction social exception timing appview)
|
@@ -14,6 +14,11 @@ class GAMeasurements
|
|
14
14
|
@property_id, @client_id = property_id, client_id
|
15
15
|
end
|
16
16
|
|
17
|
+
def set_client_id_from_cookie(cookie)
|
18
|
+
# ref https://plus.google.com/110147996971766876369/posts/Mz1ksPoBGHx
|
19
|
+
@client_id = cookie.to_s.split('.').last(2).join('.')
|
20
|
+
end
|
21
|
+
|
17
22
|
TYPES.each do |type|
|
18
23
|
define_method(type){ |params| post(type, params) }
|
19
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ga-measurements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuid
|