analytical 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +8 -1
- data/VERSION +1 -1
- data/analytical.gemspec +3 -2
- data/example/config/analytical.yml +16 -0
- data/lib/analytical/adwords.rb +62 -0
- metadata +4 -3
data/README.rdoc
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
= Analytical
|
2
2
|
|
3
3
|
Gem for managing multiple analytics services in your rails app.
|
4
|
-
|
4
|
+
|
5
|
+
Service implementations include:
|
6
|
+
* Google Analytics
|
7
|
+
* Google Adwords (conversion tracking)
|
8
|
+
* Clicky[http://getclicky.com]
|
9
|
+
* KISSMetrics[http://kissmetrics.com]
|
10
|
+
* Hubspot[http://hubspot.com]
|
11
|
+
* CrazyEgg[http://www.crazyegg.com]
|
5
12
|
|
6
13
|
== Usage
|
7
14
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.14.0
|
data/analytical.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{analytical}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.14.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Krall"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-16}
|
13
13
|
s.description = %q{Gem for managing multiple analytics services in your rails app.}
|
14
14
|
s.email = %q{josh@transfs.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -75,6 +75,7 @@ Gem::Specification.new do |s|
|
|
75
75
|
"example/test/unit/helpers/page_helper_test.rb",
|
76
76
|
"example/vendor/plugins/.gitkeep",
|
77
77
|
"lib/analytical.rb",
|
78
|
+
"lib/analytical/adwords.rb",
|
78
79
|
"lib/analytical/api.rb",
|
79
80
|
"lib/analytical/base.rb",
|
80
81
|
"lib/analytical/bot_detector.rb",
|
@@ -4,3 +4,19 @@ clicky:
|
|
4
4
|
key: clicky_12345
|
5
5
|
kiss_metrics:
|
6
6
|
key: kiss_metrics_12345
|
7
|
+
adwords:
|
8
|
+
'Some Event':
|
9
|
+
id: 4444555555
|
10
|
+
language: en
|
11
|
+
format: 2
|
12
|
+
color: ffffff
|
13
|
+
label: xxxxxxxxxxxxxxxx
|
14
|
+
value: 0
|
15
|
+
'Another Event':
|
16
|
+
id: 1111333333
|
17
|
+
language: en
|
18
|
+
format: 2
|
19
|
+
color: ffffff
|
20
|
+
label: yyyyyyyyyyyyyyyy
|
21
|
+
value: 0
|
22
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Analytical
|
2
|
+
module Adwords
|
3
|
+
class Api
|
4
|
+
include Analytical::Base::Api
|
5
|
+
|
6
|
+
def initialize(parent, options={})
|
7
|
+
super
|
8
|
+
@tracking_command_location = :body_append
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_javascript(location)
|
12
|
+
return ''
|
13
|
+
end
|
14
|
+
|
15
|
+
#
|
16
|
+
# Define conversion events in analytical.yml like:
|
17
|
+
#
|
18
|
+
# adwords:
|
19
|
+
# 'Some Event':
|
20
|
+
# id: 4444555555
|
21
|
+
# language: en
|
22
|
+
# format: 2
|
23
|
+
# color: ffffff
|
24
|
+
# label: xxxxxxxxxxxxxxxx
|
25
|
+
# value: 0
|
26
|
+
# 'Another Event':
|
27
|
+
# id: 1111333333
|
28
|
+
# language: en
|
29
|
+
# format: 2
|
30
|
+
# color: ffffff
|
31
|
+
# label: yyyyyyyyyyyyyyyy
|
32
|
+
# value: 0
|
33
|
+
#
|
34
|
+
def event(name, *args)
|
35
|
+
html = ''
|
36
|
+
if conversion = options[name]
|
37
|
+
html = <<-HTML
|
38
|
+
<!-- Google Code for PPC Landing Page Conversion Page -->
|
39
|
+
<script type="text/javascript">
|
40
|
+
/* <![CDATA[ */
|
41
|
+
var google_conversion_id = #{conversion[:id]};
|
42
|
+
var google_conversion_language = "#{conversion[:language]}";
|
43
|
+
var google_conversion_format = "#{conversion[:format]}";
|
44
|
+
var google_conversion_color = "#{conversion[:color]}";
|
45
|
+
var google_conversion_label = "#{conversion[:label]}";
|
46
|
+
var google_conversion_value = #{conversion[:value]};
|
47
|
+
/* ]]> */
|
48
|
+
</script>
|
49
|
+
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"></script>
|
50
|
+
<noscript>
|
51
|
+
<div style="display:inline;">
|
52
|
+
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/#{conversion[:id]}/?label=#{conversion[:label]}&guid=ON&script=0"/>
|
53
|
+
</div>
|
54
|
+
</noscript>
|
55
|
+
HTML
|
56
|
+
end
|
57
|
+
html
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 14
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.14.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Joshua Krall
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-16 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- example/test/unit/helpers/page_helper_test.rb
|
112
112
|
- example/vendor/plugins/.gitkeep
|
113
113
|
- lib/analytical.rb
|
114
|
+
- lib/analytical/adwords.rb
|
114
115
|
- lib/analytical/api.rb
|
115
116
|
- lib/analytical/base.rb
|
116
117
|
- lib/analytical/bot_detector.rb
|