analytical 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +10 -0
- data/Gemfile.lock +56 -0
- data/Guardfile +8 -0
- data/README.rdoc +7 -1
- data/Rakefile +2 -4
- data/VERSION +1 -1
- data/analytical.gemspec +146 -114
- data/example/config/analytical.yml +3 -1
- data/lib/analytical/modules/click_tale.rb +47 -0
- data/lib/analytical/modules/google.rb +1 -1
- data/lib/analytical/modules/google_optimizer.rb +62 -0
- data/lib/analytical/modules/loopfuse.rb +30 -0
- data/lib/analytical/modules/mixpanel.rb +6 -1
- data/lib/analytical/modules/performancing.rb +34 -0
- data/lib/analytical/modules/quantcast.rb +49 -0
- data/spec/analytical/modules/mixpanel_spec.rb +2 -2
- data/spec/analytical/modules/quantcast.rb +26 -0
- metadata +142 -15
- data/.gitignore +0 -21
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (2.3.10)
|
5
|
+
actionpack (= 2.3.10)
|
6
|
+
actionpack (2.3.10)
|
7
|
+
activesupport (= 2.3.10)
|
8
|
+
rack (~> 1.1.0)
|
9
|
+
activerecord (2.3.10)
|
10
|
+
activesupport (= 2.3.10)
|
11
|
+
activeresource (2.3.10)
|
12
|
+
activesupport (= 2.3.10)
|
13
|
+
activesupport (2.3.10)
|
14
|
+
configuration (1.2.0)
|
15
|
+
diff-lcs (1.1.2)
|
16
|
+
git (1.2.5)
|
17
|
+
growl (1.0.3)
|
18
|
+
guard (0.3.0)
|
19
|
+
open_gem (~> 1.4.2)
|
20
|
+
thor (~> 0.14.6)
|
21
|
+
guard-rspec (0.1.9)
|
22
|
+
guard (>= 0.2.2)
|
23
|
+
jeweler (1.5.2)
|
24
|
+
bundler (~> 1.0.0)
|
25
|
+
git (>= 1.2.5)
|
26
|
+
rake
|
27
|
+
launchy (0.3.7)
|
28
|
+
configuration (>= 0.0.5)
|
29
|
+
rake (>= 0.8.1)
|
30
|
+
open_gem (1.4.2)
|
31
|
+
launchy (~> 0.3.5)
|
32
|
+
rack (1.1.0)
|
33
|
+
rails (2.3.10)
|
34
|
+
actionmailer (= 2.3.10)
|
35
|
+
actionpack (= 2.3.10)
|
36
|
+
activerecord (= 2.3.10)
|
37
|
+
activeresource (= 2.3.10)
|
38
|
+
activesupport (= 2.3.10)
|
39
|
+
rake (>= 0.8.3)
|
40
|
+
rake (0.8.7)
|
41
|
+
rb-fsevent (0.3.10)
|
42
|
+
rspec (1.3.0)
|
43
|
+
thor (0.14.6)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
diff-lcs
|
50
|
+
growl
|
51
|
+
guard
|
52
|
+
guard-rspec
|
53
|
+
jeweler
|
54
|
+
rails (~> 2.3)
|
55
|
+
rb-fsevent
|
56
|
+
rspec (= 1.3)
|
data/Guardfile
ADDED
data/README.rdoc
CHANGED
@@ -12,6 +12,11 @@ Service implementations include:
|
|
12
12
|
* Chartbeat[http://chartbeat.com]
|
13
13
|
* {ComScore Direct}[http://direct.comscore.com]
|
14
14
|
* Optimizely[http://www.optimizely.com]
|
15
|
+
* Loopfuse
|
16
|
+
* Clicktale
|
17
|
+
* Google Website Optimizer
|
18
|
+
* Performancing
|
19
|
+
* Quantcast[http://www.quantcast.com]
|
15
20
|
|
16
21
|
== Usage
|
17
22
|
|
@@ -73,7 +78,7 @@ However, if you would like to be able to queue commands between requests... ther
|
|
73
78
|
|
74
79
|
This will store the queued commands in the user session, clearing them out when they are emitted to the client, but allowing you to make calls like:
|
75
80
|
|
76
|
-
|
81
|
+
analytical.track 'something'
|
77
82
|
|
78
83
|
... in your controller. After a redirect, the corresponding track() call will be emitted in the next request made by the client.
|
79
84
|
NOTE: This is new and somewhat experimental, and could cause problems if you store large amounts of data in the session. (there is a 4k limit to session data)
|
@@ -96,6 +101,7 @@ These fine folks have contributed patches and new features to this project:
|
|
96
101
|
|
97
102
|
* {Adam Anderson}[http://github.com/scudco]
|
98
103
|
* {Bryan Liles}[http://github.com/bryanl]
|
104
|
+
* {Nathan Phelps}[http://github.com/nwp]
|
99
105
|
|
100
106
|
Thanks guys!
|
101
107
|
|
data/Rakefile
CHANGED
@@ -7,9 +7,9 @@ begin
|
|
7
7
|
gem.name = "analytical"
|
8
8
|
gem.summary = %Q{Gem for managing multiple analytics services in your rails app.}
|
9
9
|
gem.description = %Q{Gem for managing multiple analytics services in your rails app.}
|
10
|
-
gem.email = "josh@
|
10
|
+
gem.email = "josh@feefighters.com"
|
11
11
|
gem.homepage = "http://github.com/jkrall/analytical"
|
12
|
-
gem.authors = ["Joshua Krall", "Nathan Phelps", "Adam Anderson"]
|
12
|
+
gem.authors = ["Joshua Krall", "Nathan Phelps", "Adam Anderson", "Kevin Menard", "Ablyamitov Ablyamit", "Kurt Werle", "Olivier Lauzon"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
14
|
gem.add_dependency "activesupport"
|
15
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
@@ -31,8 +31,6 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
|
|
31
31
|
spec.rcov = true
|
32
32
|
end
|
33
33
|
|
34
|
-
task :spec => :check_dependencies
|
35
|
-
|
36
34
|
task :default => :spec
|
37
35
|
|
38
36
|
require 'rake/rdoctask'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.0
|
data/analytical.gemspec
CHANGED
@@ -1,138 +1,146 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{analytical}
|
8
|
-
s.version = "2.
|
8
|
+
s.version = "2.7.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Joshua Krall", "Nathan Phelps", "Adam Anderson"]
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = ["Joshua Krall", "Nathan Phelps", "Adam Anderson", "Kevin Menard", "Ablyamitov Ablyamit", "Kurt Werle", "Olivier Lauzon"]
|
12
|
+
s.date = %q{2011-03-15}
|
13
13
|
s.description = %q{Gem for managing multiple analytics services in your rails app.}
|
14
|
-
s.email = %q{josh@
|
14
|
+
s.email = %q{josh@feefighters.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"Guardfile",
|
24
|
+
"LICENSE",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"analytical.gemspec",
|
29
|
+
"example/.gitignore",
|
30
|
+
"example/Gemfile",
|
31
|
+
"example/Gemfile.lock",
|
32
|
+
"example/README",
|
33
|
+
"example/Rakefile",
|
34
|
+
"example/app/controllers/application_controller.rb",
|
35
|
+
"example/app/controllers/page_controller.rb",
|
36
|
+
"example/app/helpers/application_helper.rb",
|
37
|
+
"example/app/helpers/page_helper.rb",
|
38
|
+
"example/app/views/layouts/application.html.erb",
|
39
|
+
"example/app/views/page/index.html.erb",
|
40
|
+
"example/app/views/page/test_a.html.erb",
|
41
|
+
"example/app/views/page/test_b.html.erb",
|
42
|
+
"example/config.ru",
|
43
|
+
"example/config/analytical.yml",
|
44
|
+
"example/config/application.rb",
|
45
|
+
"example/config/boot.rb",
|
46
|
+
"example/config/database.yml",
|
47
|
+
"example/config/environment.rb",
|
48
|
+
"example/config/environments/development.rb",
|
49
|
+
"example/config/environments/production.rb",
|
50
|
+
"example/config/environments/test.rb",
|
51
|
+
"example/config/initializers/backtrace_silencers.rb",
|
52
|
+
"example/config/initializers/inflections.rb",
|
53
|
+
"example/config/initializers/mime_types.rb",
|
54
|
+
"example/config/initializers/secret_token.rb",
|
55
|
+
"example/config/initializers/session_store.rb",
|
56
|
+
"example/config/locales/en.yml",
|
57
|
+
"example/config/routes.rb",
|
58
|
+
"example/db/seeds.rb",
|
59
|
+
"example/doc/README_FOR_APP",
|
60
|
+
"example/lib/tasks/.gitkeep",
|
61
|
+
"example/public/404.html",
|
62
|
+
"example/public/422.html",
|
63
|
+
"example/public/500.html",
|
64
|
+
"example/public/favicon.ico",
|
65
|
+
"example/public/images/rails.png",
|
66
|
+
"example/public/javascripts/application.js",
|
67
|
+
"example/public/javascripts/controls.js",
|
68
|
+
"example/public/javascripts/dragdrop.js",
|
69
|
+
"example/public/javascripts/effects.js",
|
70
|
+
"example/public/javascripts/prototype.js",
|
71
|
+
"example/public/javascripts/rails.js",
|
72
|
+
"example/public/robots.txt",
|
73
|
+
"example/public/stylesheets/.gitkeep",
|
74
|
+
"example/script/rails",
|
75
|
+
"example/test/functional/page_controller_test.rb",
|
76
|
+
"example/test/performance/browsing_test.rb",
|
77
|
+
"example/test/test_helper.rb",
|
78
|
+
"example/test/unit/helpers/page_helper_test.rb",
|
79
|
+
"example/vendor/plugins/.gitkeep",
|
80
|
+
"lib/analytical.rb",
|
81
|
+
"lib/analytical/api.rb",
|
82
|
+
"lib/analytical/bot_detector.rb",
|
83
|
+
"lib/analytical/command_store.rb",
|
84
|
+
"lib/analytical/modules/adwords.rb",
|
85
|
+
"lib/analytical/modules/base.rb",
|
86
|
+
"lib/analytical/modules/chartbeat.rb",
|
87
|
+
"lib/analytical/modules/click_tale.rb",
|
88
|
+
"lib/analytical/modules/clicky.rb",
|
89
|
+
"lib/analytical/modules/comscore.rb",
|
90
|
+
"lib/analytical/modules/console.rb",
|
91
|
+
"lib/analytical/modules/crazy_egg.rb",
|
92
|
+
"lib/analytical/modules/google.rb",
|
93
|
+
"lib/analytical/modules/google_optimizer.rb",
|
94
|
+
"lib/analytical/modules/hubspot.rb",
|
95
|
+
"lib/analytical/modules/kiss_metrics.rb",
|
96
|
+
"lib/analytical/modules/loopfuse.rb",
|
97
|
+
"lib/analytical/modules/microsoft_ads.rb",
|
98
|
+
"lib/analytical/modules/mixpanel.rb",
|
99
|
+
"lib/analytical/modules/optimizely.rb",
|
100
|
+
"lib/analytical/modules/performancing.rb",
|
101
|
+
"lib/analytical/modules/quantcast.rb",
|
102
|
+
"lib/analytical/session_command_store.rb",
|
103
|
+
"rails/init.rb",
|
104
|
+
"spec/analytical/api_spec.rb",
|
105
|
+
"spec/analytical/bot_detector_spec.rb",
|
106
|
+
"spec/analytical/command_store_spec.rb",
|
107
|
+
"spec/analytical/modules/adwords_spec.rb",
|
108
|
+
"spec/analytical/modules/base_spec.rb",
|
109
|
+
"spec/analytical/modules/chartbeat_spec.rb",
|
110
|
+
"spec/analytical/modules/clicky_spec.rb",
|
111
|
+
"spec/analytical/modules/comscore_spec.rb",
|
112
|
+
"spec/analytical/modules/google_spec.rb",
|
113
|
+
"spec/analytical/modules/kiss_metrics_spec.rb",
|
114
|
+
"spec/analytical/modules/mixpanel_spec.rb",
|
115
|
+
"spec/analytical/modules/optimizely_spec.rb",
|
116
|
+
"spec/analytical/modules/quantcast.rb",
|
117
|
+
"spec/analytical/session_command_store_spec.rb",
|
118
|
+
"spec/analytical_spec.rb",
|
119
|
+
"spec/config/analytical.yml",
|
120
|
+
"spec/spec.opts",
|
121
|
+
"spec/spec_helper.rb"
|
114
122
|
]
|
115
123
|
s.homepage = %q{http://github.com/jkrall/analytical}
|
116
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
117
124
|
s.require_paths = ["lib"]
|
118
125
|
s.rubygems_version = %q{1.3.7}
|
119
126
|
s.summary = %q{Gem for managing multiple analytics services in your rails app.}
|
120
127
|
s.test_files = [
|
121
128
|
"spec/analytical/api_spec.rb",
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
129
|
+
"spec/analytical/bot_detector_spec.rb",
|
130
|
+
"spec/analytical/command_store_spec.rb",
|
131
|
+
"spec/analytical/modules/adwords_spec.rb",
|
132
|
+
"spec/analytical/modules/base_spec.rb",
|
133
|
+
"spec/analytical/modules/chartbeat_spec.rb",
|
134
|
+
"spec/analytical/modules/clicky_spec.rb",
|
135
|
+
"spec/analytical/modules/comscore_spec.rb",
|
136
|
+
"spec/analytical/modules/google_spec.rb",
|
137
|
+
"spec/analytical/modules/kiss_metrics_spec.rb",
|
138
|
+
"spec/analytical/modules/mixpanel_spec.rb",
|
139
|
+
"spec/analytical/modules/optimizely_spec.rb",
|
140
|
+
"spec/analytical/modules/quantcast.rb",
|
141
|
+
"spec/analytical/session_command_store_spec.rb",
|
142
|
+
"spec/analytical_spec.rb",
|
143
|
+
"spec/spec_helper.rb"
|
136
144
|
]
|
137
145
|
|
138
146
|
if s.respond_to? :specification_version then
|
@@ -140,13 +148,37 @@ Gem::Specification.new do |s|
|
|
140
148
|
s.specification_version = 3
|
141
149
|
|
142
150
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
151
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
152
|
+
s.add_runtime_dependency(%q<rspec>, ["= 1.3"])
|
153
|
+
s.add_runtime_dependency(%q<diff-lcs>, [">= 0"])
|
154
|
+
s.add_runtime_dependency(%q<rails>, ["~> 2.3"])
|
155
|
+
s.add_runtime_dependency(%q<guard>, [">= 0"])
|
156
|
+
s.add_runtime_dependency(%q<guard-rspec>, [">= 0"])
|
157
|
+
s.add_runtime_dependency(%q<rb-fsevent>, [">= 0"])
|
158
|
+
s.add_runtime_dependency(%q<growl>, [">= 0"])
|
143
159
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
144
160
|
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
145
161
|
else
|
162
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
163
|
+
s.add_dependency(%q<rspec>, ["= 1.3"])
|
164
|
+
s.add_dependency(%q<diff-lcs>, [">= 0"])
|
165
|
+
s.add_dependency(%q<rails>, ["~> 2.3"])
|
166
|
+
s.add_dependency(%q<guard>, [">= 0"])
|
167
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
168
|
+
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
169
|
+
s.add_dependency(%q<growl>, [">= 0"])
|
146
170
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
147
171
|
s.add_dependency(%q<activesupport>, [">= 0"])
|
148
172
|
end
|
149
173
|
else
|
174
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
175
|
+
s.add_dependency(%q<rspec>, ["= 1.3"])
|
176
|
+
s.add_dependency(%q<diff-lcs>, [">= 0"])
|
177
|
+
s.add_dependency(%q<rails>, ["~> 2.3"])
|
178
|
+
s.add_dependency(%q<guard>, [">= 0"])
|
179
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
180
|
+
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
181
|
+
s.add_dependency(%q<growl>, [">= 0"])
|
150
182
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
151
183
|
s.add_dependency(%q<activesupport>, [">= 0"])
|
152
184
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Modules
|
3
|
+
class ClickTale
|
4
|
+
include Analytical::Modules::Base
|
5
|
+
|
6
|
+
def initialize(options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = [:body_prepend, :body_append]
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
init_location(location) do
|
13
|
+
case location.to_sym
|
14
|
+
when :body_prepend
|
15
|
+
js = <<-HTML
|
16
|
+
<!-- Analytical Init: ClickTale Top part -->
|
17
|
+
<script type="text/javascript">
|
18
|
+
var WRInitTime=(new Date()).getTime();
|
19
|
+
</script>
|
20
|
+
<!-- ClickTale end of Top part -->
|
21
|
+
HTML
|
22
|
+
js
|
23
|
+
when :body_append
|
24
|
+
js = <<-HTML
|
25
|
+
<!-- Analytical Init: ClickTale Bottom part -->
|
26
|
+
<div id="ClickTaleDiv" style="display: none;"></div>
|
27
|
+
<script type='text/javascript'>
|
28
|
+
document.write(unescape("%3Cscript%20src='"+
|
29
|
+
(document.location.protocol=='https:'?
|
30
|
+
'https://clicktale.pantherssl.com/':
|
31
|
+
'http://s.clicktale.net/')+
|
32
|
+
"WRb6.js'%20type='text/javascript'%3E%3C/script%3E"));
|
33
|
+
</script>
|
34
|
+
<script type="text/javascript">
|
35
|
+
var ClickTaleSSL=1;
|
36
|
+
if(typeof ClickTale=='function') ClickTale(#{@options[:project_id]},#{@options[:site_traffic]},"www");
|
37
|
+
</script>
|
38
|
+
<!-- ClickTale end of Bottom part -->
|
39
|
+
HTML
|
40
|
+
js
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -14,7 +14,7 @@ module Analytical
|
|
14
14
|
<!-- Analytical Init: Google -->
|
15
15
|
<script type="text/javascript">
|
16
16
|
var _gaq = _gaq || [];
|
17
|
-
_gaq.push(['_setAccount', '#{options[:key]}'], ['_trackPageview']);
|
17
|
+
_gaq.push(['_setAccount', '#{options[:key]}'], ['_setDomainName', '#{options[:domain]}'], ['_trackPageview']);
|
18
18
|
(function() {
|
19
19
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
20
20
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Modules
|
3
|
+
class GoogleOptimizer
|
4
|
+
include Analytical::Modules::Base
|
5
|
+
|
6
|
+
def initialize(options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = :head_prepend
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
init_location(location) do
|
13
|
+
js = <<-HTML
|
14
|
+
<!-- Analytical Init: Google Website Optimizer Control Script -->
|
15
|
+
<script>
|
16
|
+
function utmx_section(){}function utmx(){}
|
17
|
+
(function(){var k='#{options[:key]}',d=document,l=d.location,c=d.cookie;function f(n){
|
18
|
+
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
|
19
|
+
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
|
20
|
+
d.write('<sc'+'ript src="'+
|
21
|
+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
|
22
|
+
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
|
23
|
+
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
|
24
|
+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
|
25
|
+
</script>
|
26
|
+
<!-- End of Google Website Optimizer Control Script -->
|
27
|
+
<!-- Analytical Init: Google Website Optimizer Tracking Script -->
|
28
|
+
<script type="text/javascript">
|
29
|
+
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
|
30
|
+
(document.location.protocol=='https:'?'s://ssl':'://www')+
|
31
|
+
'.google-analytics.com/ga.js"></sc'+'ript>')</script>
|
32
|
+
<script type="text/javascript">
|
33
|
+
try {
|
34
|
+
var gwoTracker=_gat._getTracker("#{options[:account]}");
|
35
|
+
gwoTracker._trackPageview("/#{options[:key]}/test");
|
36
|
+
}catch(err){}</script>
|
37
|
+
<!-- End of Google Website Optimizer Tracking Script -->
|
38
|
+
HTML
|
39
|
+
js
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def conversion(*args)
|
44
|
+
js = <<-HTML
|
45
|
+
<!-- Analytical Init: Google Website Optimizer Conversion Script -->
|
46
|
+
<script type="text/javascript">
|
47
|
+
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
|
48
|
+
(document.location.protocol=='https:'?'s://ssl':'://www')+
|
49
|
+
'.google-analytics.com/ga.js"></sc'+'ript>')</script>
|
50
|
+
<script type="text/javascript">
|
51
|
+
try {
|
52
|
+
var gwoTracker=_gat._getTracker("#{options[:account]}");
|
53
|
+
gwoTracker._trackPageview("/#{options[:key]}/goal");
|
54
|
+
}catch(err){}</script>
|
55
|
+
<!-- End of Google Website Optimizer Conversion Script -->
|
56
|
+
HTML
|
57
|
+
js
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Modules
|
3
|
+
class Loopfuse
|
4
|
+
include Analytical::Modules::Base
|
5
|
+
|
6
|
+
def initialize(options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = :body_append
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
init_location(location) do
|
13
|
+
js = <<-HTML
|
14
|
+
<!-- Analytical Init: LOOPFUSE TRACKING -->
|
15
|
+
<script type="text/javascript">
|
16
|
+
var LFHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
17
|
+
document.write(unescape("%3Cscript src='" + LFHost + "lfov.net/webrecorder/js/listen.js' type='text/javascript'%3E%3C/script%3E"));
|
18
|
+
</script>
|
19
|
+
<script type="text/javascript">
|
20
|
+
_lf_cid = "#{options[:cid]}";
|
21
|
+
_lf_remora();
|
22
|
+
</script>
|
23
|
+
<!-- END: LOOPFUSE TRACKING -->
|
24
|
+
HTML
|
25
|
+
js
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -12,7 +12,7 @@ module Analytical
|
|
12
12
|
init_location(location) do
|
13
13
|
js = <<-HTML
|
14
14
|
<!-- Analytical Init: Mixpanel -->
|
15
|
-
<script type="text/javascript" src="
|
15
|
+
<script type="text/javascript" src="https://api.mixpanel.com/site_media/js/api/mixpanel.js"></script>
|
16
16
|
<script type="text/javascript">
|
17
17
|
try {
|
18
18
|
var mpmetrics = new MixpanelLib('#{options[:key]}');
|
@@ -31,6 +31,11 @@ module Analytical
|
|
31
31
|
"mpmetrics.track('#{event}', #{properties.to_json}, #{callback});"
|
32
32
|
end
|
33
33
|
|
34
|
+
# Used to set "Super Properties" - http://mixpanel.com/api/docs/guides/super-properties
|
35
|
+
def set(properties)
|
36
|
+
"mpmetrics.register(#{properties.to_json});"
|
37
|
+
end
|
38
|
+
|
34
39
|
def identify(id, *args)
|
35
40
|
"mpmetrics.identify('#{id}');"
|
36
41
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Modules
|
3
|
+
class Performancing
|
4
|
+
include Analytical::Modules::Base
|
5
|
+
|
6
|
+
def initialize(options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = :body_append
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
init_location(location) do
|
13
|
+
js = <<-HTML
|
14
|
+
<!-- Analytical Init: Performancing Metrics -->
|
15
|
+
<script type="text/javascript">
|
16
|
+
var clicky = { log: function(){ return; }, goal: function(){ return; }};
|
17
|
+
var clicky_site_id = #{options[:site_id]};
|
18
|
+
(function() {
|
19
|
+
var s = document.createElement('script');
|
20
|
+
s.type = 'text/javascript';
|
21
|
+
s.async = true;
|
22
|
+
s.src = ( document.location.protocol == 'https:' ? 'https://pmetrics.performancing.com' : 'http://pmetrics.performancing.com' ) + '/js';
|
23
|
+
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
|
24
|
+
})();
|
25
|
+
</script>
|
26
|
+
<!-- End Performancing Metrics -->
|
27
|
+
HTML
|
28
|
+
js
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Modules
|
3
|
+
class Quantcast
|
4
|
+
include Analytical::Modules::Base
|
5
|
+
|
6
|
+
def initialize(options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = [:head_append, :body_append]
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
init_location(location) do
|
13
|
+
case location.to_sym
|
14
|
+
when :head_append
|
15
|
+
js = <<-HTML
|
16
|
+
<!-- Analytical Head Init: Quantcast -->
|
17
|
+
<script type="text/javascript">
|
18
|
+
var _qevents = _qevents || [];
|
19
|
+
|
20
|
+
(function() {
|
21
|
+
var elem = document.createElement('script');
|
22
|
+
|
23
|
+
elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
|
24
|
+
elem.async = true;
|
25
|
+
elem.type = "text/javascript";
|
26
|
+
var scpt = document.getElementsByTagName('script')[0];
|
27
|
+
scpt.parentNode.insertBefore(elem, scpt);
|
28
|
+
})();
|
29
|
+
</script>
|
30
|
+
HTML
|
31
|
+
js
|
32
|
+
when :body_append
|
33
|
+
js = <<-HTML
|
34
|
+
<!-- Analytical Body Init: Quantcast -->
|
35
|
+
<script type="text/javascript">
|
36
|
+
_qevents.push( { qacct:"#{options[:key]}"} );
|
37
|
+
</script>
|
38
|
+
<noscript>
|
39
|
+
<div style="display: none;"><img src="//pixel.quantserve.com/pixel/#{options[:key]}.gif" height="1" width="1" alt="Quantcast"/></div>
|
40
|
+
</noscript>
|
41
|
+
HTML
|
42
|
+
js
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -23,7 +23,7 @@ describe "Analytical::Modules::Mixpanel" do
|
|
23
23
|
describe '#track' do
|
24
24
|
it 'should return the tracking javascript' do
|
25
25
|
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :key=>'abcdef'
|
26
|
-
@api.track('pagename', {:some=>'data'}).should == "mpmetrics.track('pagename', {\"some\":\"data\"}, function(){}
|
26
|
+
@api.track('pagename', {:some=>'data'}).should == "mpmetrics.track('pagename', {\"some\":\"data\"}, function(){});"
|
27
27
|
end
|
28
28
|
it 'should return the tracking javascript with a callback' do
|
29
29
|
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :key=>'abcdef'
|
@@ -33,7 +33,7 @@ describe "Analytical::Modules::Mixpanel" do
|
|
33
33
|
describe '#event' do
|
34
34
|
it 'should return a js string' do
|
35
35
|
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
36
|
-
@api.event('My Funnel', {:step=>5, :goal=>'thegoal'}).should == "mpmetrics.track_funnel('My Funnel', '5', 'thegoal', {}, function(){}
|
36
|
+
@api.event('My Funnel', {:step=>5, :goal=>'thegoal'}).should == "mpmetrics.track_funnel('My Funnel', '5', 'thegoal', {}, function(){});"
|
37
37
|
end
|
38
38
|
describe 'without the proper data' do
|
39
39
|
it 'should return an error string with blank funnel' do
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "Analytical::Modules::Quantcast" do
|
4
|
+
before(:each) do
|
5
|
+
@parent = mock('api', :options=>{:quantcast=>{:key=>1234}})
|
6
|
+
end
|
7
|
+
describe 'on initialize' do
|
8
|
+
it 'should set the command_location' do
|
9
|
+
a = Analytical::Modules::Quantcast.new :parent=>@parent, :key=>1234
|
10
|
+
a.tracking_command_location.should == [:head_append, :body_append]
|
11
|
+
end
|
12
|
+
it 'should set the options' do
|
13
|
+
a = Analytical::Modules::Quantcast.new :parent=>@parent, :key=>12345
|
14
|
+
a.options.should == {:key=>12345, :parent=>@parent}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe '#init_javascript' do
|
18
|
+
it 'should return the init javascript' do
|
19
|
+
@api = Analytical::Modules::Quantcast.new :parent=>@parent, :key=>12345
|
20
|
+
@api.init_javascript(:head_prepend).should =~ ''
|
21
|
+
@api.init_javascript(:head_append).should == /var._qevents.=._qevents.\|\|.\[\];/
|
22
|
+
@api.init_javascript(:body_prepend).should == ''
|
23
|
+
@api.init_javascript(:body_append).should =~ /_qevents.push\(.\{.qacct:"12345"\} \);/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,148 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analytical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 7
|
9
9
|
- 0
|
10
|
-
version: 2.
|
10
|
+
version: 2.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Krall
|
14
14
|
- Nathan Phelps
|
15
15
|
- Adam Anderson
|
16
|
+
- Kevin Menard
|
17
|
+
- Ablyamitov Ablyamit
|
18
|
+
- Kurt Werle
|
19
|
+
- Olivier Lauzon
|
16
20
|
autorequire:
|
17
21
|
bindir: bin
|
18
22
|
cert_chain: []
|
19
23
|
|
20
|
-
date: 2011-
|
24
|
+
date: 2011-03-15 00:00:00 -05:00
|
21
25
|
default_executable:
|
22
26
|
dependencies:
|
23
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
type: :runtime
|
29
|
+
prerelease: false
|
30
|
+
name: jeweler
|
31
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
hash: 3
|
37
|
+
segments:
|
38
|
+
- 0
|
39
|
+
version: "0"
|
40
|
+
requirement: *id001
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
type: :runtime
|
43
|
+
prerelease: false
|
24
44
|
name: rspec
|
45
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - "="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
hash: 9
|
51
|
+
segments:
|
52
|
+
- 1
|
53
|
+
- 3
|
54
|
+
version: "1.3"
|
55
|
+
requirement: *id002
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
name: diff-lcs
|
60
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 3
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
69
|
+
requirement: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
name: rails
|
74
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ~>
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 5
|
80
|
+
segments:
|
81
|
+
- 2
|
82
|
+
- 3
|
83
|
+
version: "2.3"
|
84
|
+
requirement: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
name: guard
|
89
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
98
|
+
requirement: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
type: :runtime
|
25
101
|
prerelease: false
|
26
|
-
|
102
|
+
name: guard-rspec
|
103
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
requirement: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
type: :runtime
|
115
|
+
prerelease: false
|
116
|
+
name: rb-fsevent
|
117
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 3
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
requirement: *id007
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
type: :runtime
|
129
|
+
prerelease: false
|
130
|
+
name: growl
|
131
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
hash: 3
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
version: "0"
|
140
|
+
requirement: *id008
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
type: :development
|
143
|
+
prerelease: false
|
144
|
+
name: rspec
|
145
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
27
146
|
none: false
|
28
147
|
requirements:
|
29
148
|
- - ">="
|
@@ -34,12 +153,12 @@ dependencies:
|
|
34
153
|
- 2
|
35
154
|
- 9
|
36
155
|
version: 1.2.9
|
37
|
-
|
38
|
-
version_requirements: *id001
|
156
|
+
requirement: *id009
|
39
157
|
- !ruby/object:Gem::Dependency
|
40
|
-
|
158
|
+
type: :runtime
|
41
159
|
prerelease: false
|
42
|
-
|
160
|
+
name: activesupport
|
161
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
43
162
|
none: false
|
44
163
|
requirements:
|
45
164
|
- - ">="
|
@@ -48,10 +167,9 @@ dependencies:
|
|
48
167
|
segments:
|
49
168
|
- 0
|
50
169
|
version: "0"
|
51
|
-
|
52
|
-
version_requirements: *id002
|
170
|
+
requirement: *id010
|
53
171
|
description: Gem for managing multiple analytics services in your rails app.
|
54
|
-
email: josh@
|
172
|
+
email: josh@feefighters.com
|
55
173
|
executables: []
|
56
174
|
|
57
175
|
extensions: []
|
@@ -61,7 +179,9 @@ extra_rdoc_files:
|
|
61
179
|
- README.rdoc
|
62
180
|
files:
|
63
181
|
- .document
|
64
|
-
-
|
182
|
+
- Gemfile
|
183
|
+
- Gemfile.lock
|
184
|
+
- Guardfile
|
65
185
|
- LICENSE
|
66
186
|
- README.rdoc
|
67
187
|
- Rakefile
|
@@ -125,16 +245,21 @@ files:
|
|
125
245
|
- lib/analytical/modules/adwords.rb
|
126
246
|
- lib/analytical/modules/base.rb
|
127
247
|
- lib/analytical/modules/chartbeat.rb
|
248
|
+
- lib/analytical/modules/click_tale.rb
|
128
249
|
- lib/analytical/modules/clicky.rb
|
129
250
|
- lib/analytical/modules/comscore.rb
|
130
251
|
- lib/analytical/modules/console.rb
|
131
252
|
- lib/analytical/modules/crazy_egg.rb
|
132
253
|
- lib/analytical/modules/google.rb
|
254
|
+
- lib/analytical/modules/google_optimizer.rb
|
133
255
|
- lib/analytical/modules/hubspot.rb
|
134
256
|
- lib/analytical/modules/kiss_metrics.rb
|
257
|
+
- lib/analytical/modules/loopfuse.rb
|
135
258
|
- lib/analytical/modules/microsoft_ads.rb
|
136
259
|
- lib/analytical/modules/mixpanel.rb
|
137
260
|
- lib/analytical/modules/optimizely.rb
|
261
|
+
- lib/analytical/modules/performancing.rb
|
262
|
+
- lib/analytical/modules/quantcast.rb
|
138
263
|
- lib/analytical/session_command_store.rb
|
139
264
|
- rails/init.rb
|
140
265
|
- spec/analytical/api_spec.rb
|
@@ -149,6 +274,7 @@ files:
|
|
149
274
|
- spec/analytical/modules/kiss_metrics_spec.rb
|
150
275
|
- spec/analytical/modules/mixpanel_spec.rb
|
151
276
|
- spec/analytical/modules/optimizely_spec.rb
|
277
|
+
- spec/analytical/modules/quantcast.rb
|
152
278
|
- spec/analytical/session_command_store_spec.rb
|
153
279
|
- spec/analytical_spec.rb
|
154
280
|
- spec/config/analytical.yml
|
@@ -159,8 +285,8 @@ homepage: http://github.com/jkrall/analytical
|
|
159
285
|
licenses: []
|
160
286
|
|
161
287
|
post_install_message:
|
162
|
-
rdoc_options:
|
163
|
-
|
288
|
+
rdoc_options: []
|
289
|
+
|
164
290
|
require_paths:
|
165
291
|
- lib
|
166
292
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -201,6 +327,7 @@ test_files:
|
|
201
327
|
- spec/analytical/modules/kiss_metrics_spec.rb
|
202
328
|
- spec/analytical/modules/mixpanel_spec.rb
|
203
329
|
- spec/analytical/modules/optimizely_spec.rb
|
330
|
+
- spec/analytical/modules/quantcast.rb
|
204
331
|
- spec/analytical/session_command_store_spec.rb
|
205
332
|
- spec/analytical_spec.rb
|
206
333
|
- spec/spec_helper.rb
|