lazy_google_analytics 0.1.5 → 0.1.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 +15 -0
- data/README.md +8 -4
- data/lib/lazy_google_analytics/client.rb +1 -0
- data/lib/lazy_google_analytics/version.rb +1 -1
- data/spec/fixtures/.DS_Store +0 -0
- data/spec/functional/client_spec.rb +15 -4
- metadata +5 -23
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
MjQyMTJkOWIxYjFkYWViZGRhYjRiMTk1YThjNGE5NTBiZTM1YmM0YQ==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
NjUyZmJiMDliOTA2Y2U0Y2U5MTlkZGQzOGQ1NzhhZGRmM2IyMWQ2Mg==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
ZTM4MThmNmNlMzZkZjM0YjI2ODdjYjUyZGQ0YzYzMTFkNDEwMWYwOTU5ZDVm
|
|
10
|
+
YWUxOGZkODk3YjAxYjhiNWFlZGYwYzlhOTQyNWEyNjJiMWIyN2QzNWQyZDU1
|
|
11
|
+
ZWE5MzBkZTU4ZDY5OTAzNWMxN2NiNjBkNDU1NmE2ZWVlZGJiYjM=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
ZjcyYzg2MjE1ODU2MzJmNGVlZjkxYWIwNDU0OTk0NTMxZTRkM2E0YjBhOTZk
|
|
14
|
+
YzBkZWRjYzFmNjgwMGI4ZGE1MzlkYmFiMDVjYWU3NTE4NTBlZWQ4NmE0M2I4
|
|
15
|
+
NzE1YmRlODMwZjRkZmFmMzQzZDgyMzVmYmRkMjVhNzVlNTQ0MzM=
|
data/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# LazyGoogleAnalytics
|
|
2
2
|
|
|
3
|
-
Lazy google analytics it´s an abstraction around google-
|
|
3
|
+
Lazy google analytics it´s an abstraction around [google-api-client](http://code.google.com/p/google-api-ruby-client/) gem, to make server to server api calls.
|
|
4
4
|
|
|
5
5
|
## Motivation
|
|
6
6
|
|
|
7
|
-
google-
|
|
7
|
+
[google-api-client](http://code.google.com/p/google-api-ruby-client/) gem is a very powerfull tool to access the api resources on google. but for me it was not very straightforward, so I come around with a simple way to implement it. that's all.
|
|
8
8
|
|
|
9
9
|
Hope you like it.
|
|
10
10
|
|
|
@@ -86,9 +86,10 @@ If you follow this simple steps , you can´t fail.
|
|
|
86
86
|
|
|
87
87
|
+ First, you have to register your api access in: [google api console](https://code.google.com/apis/console/) and create a server key.
|
|
88
88
|
+ Download the p12 key.
|
|
89
|
-
+ Add the created @developer.gserviceaccount.com to your users list in the analytics user panel of the profile you want to retrieve the data, otherwise it wont work.
|
|
89
|
+
+ Add the created @developer.gserviceaccount.com to your users list in the analytics .user panel of the profile you want to retrieve the data, otherwise it wont work.
|
|
90
90
|
+ Note that the profile_id of the configuration object is not the UA-XXXXX number , is the Google Analytics profile number.
|
|
91
|
-
+ To play with the api to tests different options (without write any code) you can use [Google Analytics Query Explorer 2](https://ga-dev-tools.appspot.com/explorer/)
|
|
91
|
+
+ To play with the api to tests different options (without write any code) you can use [Google Analytics Query Explorer 2](https://ga-dev-tools.appspot.com/explorer/).
|
|
92
|
+
+ And last but not least [google analytics documentation](https://developers.google.com/analytics/).
|
|
92
93
|
|
|
93
94
|
## Contributing
|
|
94
95
|
|
|
@@ -98,3 +99,6 @@ If you follow this simple steps , you can´t fail.
|
|
|
98
99
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
99
100
|
5. Create new Pull Request
|
|
100
101
|
|
|
102
|
+
|
|
103
|
+
Copyright (c) 2013 miguel michelson, released under the MIT license
|
|
104
|
+
|
data/spec/fixtures/.DS_Store
CHANGED
|
Binary file
|
|
@@ -27,9 +27,9 @@ describe "Client" do
|
|
|
27
27
|
describe "override entire options" do
|
|
28
28
|
before :each do
|
|
29
29
|
@report = LazyGoogleAnalytics::Client.new()
|
|
30
|
-
@report.parameters({'ids'
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
@report.parameters({'ids' => "ga:123456",
|
|
31
|
+
'dimensions' => "ga:year,ga:month",
|
|
32
|
+
'sort' => "ga:month,ga:day" })
|
|
33
33
|
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -70,7 +70,18 @@ describe "Client" do
|
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
it "find objects object" do
|
|
73
|
-
@client.results
|
|
73
|
+
@client.results.should_not be_nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it "headers raw" do
|
|
77
|
+
@client.results.data.column_headers[0]["name"].should == "ga:day"
|
|
78
|
+
@client.results.data.column_headers[1]["name"].should == "ga:month"
|
|
79
|
+
@client.results.data.column_headers[2]["name"].should == "ga:visits"
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it "rows raw" do
|
|
83
|
+
@client.results.data.rows.class.should be Array
|
|
84
|
+
@client.results.data.rows.should_not be_empty
|
|
74
85
|
end
|
|
75
86
|
|
|
76
87
|
it "headers" do
|
metadata
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lazy_google_analytics
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.1.6
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- miguel michelson
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: google-api-client
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
17
|
- - ! '>='
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
@@ -22,7 +20,6 @@ dependencies:
|
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
24
|
- - ! '>='
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
@@ -30,7 +27,6 @@ dependencies:
|
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: bundler
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
31
|
- - ~>
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
@@ -38,7 +34,6 @@ dependencies:
|
|
|
38
34
|
type: :development
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
38
|
- - ~>
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
@@ -46,7 +41,6 @@ dependencies:
|
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: rake
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
45
|
- - ! '>='
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
@@ -54,7 +48,6 @@ dependencies:
|
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
52
|
- - ! '>='
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
@@ -62,7 +55,6 @@ dependencies:
|
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: hash-deep-merge
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
59
|
- - ! '>='
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
@@ -70,7 +62,6 @@ dependencies:
|
|
|
70
62
|
type: :runtime
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
66
|
- - ! '>='
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
@@ -78,7 +69,6 @@ dependencies:
|
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
|
79
70
|
name: activesupport
|
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
72
|
requirements:
|
|
83
73
|
- - ! '>='
|
|
84
74
|
- !ruby/object:Gem::Version
|
|
@@ -86,7 +76,6 @@ dependencies:
|
|
|
86
76
|
type: :runtime
|
|
87
77
|
prerelease: false
|
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
none: false
|
|
90
79
|
requirements:
|
|
91
80
|
- - ! '>='
|
|
92
81
|
- !ruby/object:Gem::Version
|
|
@@ -129,33 +118,26 @@ files:
|
|
|
129
118
|
homepage: ''
|
|
130
119
|
licenses:
|
|
131
120
|
- MIT
|
|
121
|
+
metadata: {}
|
|
132
122
|
post_install_message:
|
|
133
123
|
rdoc_options: []
|
|
134
124
|
require_paths:
|
|
135
125
|
- lib
|
|
136
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
|
-
none: false
|
|
138
127
|
requirements:
|
|
139
128
|
- - ! '>='
|
|
140
129
|
- !ruby/object:Gem::Version
|
|
141
130
|
version: '0'
|
|
142
|
-
segments:
|
|
143
|
-
- 0
|
|
144
|
-
hash: 3806553411161090089
|
|
145
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
|
-
none: false
|
|
147
132
|
requirements:
|
|
148
133
|
- - ! '>='
|
|
149
134
|
- !ruby/object:Gem::Version
|
|
150
135
|
version: '0'
|
|
151
|
-
segments:
|
|
152
|
-
- 0
|
|
153
|
-
hash: 3806553411161090089
|
|
154
136
|
requirements: []
|
|
155
137
|
rubyforge_project:
|
|
156
|
-
rubygems_version:
|
|
138
|
+
rubygems_version: 2.0.3
|
|
157
139
|
signing_key:
|
|
158
|
-
specification_version:
|
|
140
|
+
specification_version: 4
|
|
159
141
|
summary: google analytics api access server 2 server for the lazy ones
|
|
160
142
|
test_files:
|
|
161
143
|
- spec/.DS_Store
|