moviepilot-gwo 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gwo.rb +3 -3
- data/spec/lib/gwo_spec.rb +12 -12
- metadata +2 -3
data/lib/gwo.rb
CHANGED
@@ -150,7 +150,7 @@ module GWO
|
|
150
150
|
\
|
151
151
|
#{ js_logger("'variant: ' + GWO_#{section}_name") }\
|
152
152
|
}
|
153
|
-
google_analytics_info += "google_analytics_info += \"
|
153
|
+
google_analytics_info += "google_analytics_info += \"&#{section}=\" + GWO_#{section}_name;" if options[:ga_tracking]
|
154
154
|
end
|
155
155
|
|
156
156
|
if options[:ga_tracking]
|
@@ -158,8 +158,8 @@ module GWO
|
|
158
158
|
variable_assignments += %{\
|
159
159
|
window.onload = function(){ \
|
160
160
|
var google_analytics_info = ''; #{google_analytics_info}; if(typeof(trackPageView) == 'function') {\
|
161
|
-
trackPageView(#{base_url} + "?ab_test
|
162
|
-
#{js_logger("#{base_url} + \"?ab_test
|
161
|
+
trackPageView(#{base_url} + "?ab_test=#{id}" + google_analytics_info);\
|
162
|
+
#{js_logger("#{base_url} + \"?ab_test=#{id}\" + google_analytics_info")}\
|
163
163
|
}\
|
164
164
|
}\
|
165
165
|
}
|
data/spec/lib/gwo_spec.rb
CHANGED
@@ -6,29 +6,29 @@ describe GWO do
|
|
6
6
|
|
7
7
|
describe "google analytics stuff" do
|
8
8
|
it "should not create any google analytics stuff by default" do
|
9
|
-
gwo_start("gwo_id", "section_name").should_not =~ /google_analytics_info \+= \"&
|
10
|
-
gwo_start("gwo_id", "section_name").should_not =~ /trackPageView\(document.location \+ \"\?ab_test=
|
9
|
+
gwo_start("gwo_id", "section_name").should_not =~ /google_analytics_info \+= \"§ion_name=\" \+ GWO_section_name_name;/
|
10
|
+
gwo_start("gwo_id", "section_name").should_not =~ /trackPageView\(document.location \+ \"\?ab_test=gwo_id\" \+ google_analytics_info\)/
|
11
11
|
end
|
12
12
|
it "should not create google analytics stuff if option is disabled" do
|
13
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => false).should_not =~ /google_analytics_info \+= \"&
|
14
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => false).should_not =~ /trackPageView\(document.location \+ \"\?ab_test=
|
13
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => false).should_not =~ /google_analytics_info \+= \"§ion_name=\" \+ GWO_section_name_name;/
|
14
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => false).should_not =~ /trackPageView\(document.location \+ \"\?ab_test=gwo_id\" \+ google_analytics_info\)/
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should create correct google analytics stuff for default urls" do
|
18
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => true).should =~ /google_analytics_info \+= \"&
|
19
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => true).should =~ /trackPageView\(document.location \+ \"\?ab_test=
|
18
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => true).should =~ /google_analytics_info \+= \"§ion_name=\" \+ GWO_section_name_name;/
|
19
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => true).should =~ /trackPageView\(document.location \+ \"\?ab_test=gwo_id\" \+ google_analytics_info\)/
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should create correct google analytics stuff for static urls" do
|
23
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => true, :ga_base_url => "http://example.com").should =~ /google_analytics_info \+= \"&
|
24
|
-
gwo_start("gwo_id", "section_name", :ga_tracking => true, :ga_base_url => "http://example.com").should =~ /trackPageView\(\"http:\/\/example\.com\" \+ \"\?ab_test=
|
23
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => true, :ga_base_url => "http://example.com").should =~ /google_analytics_info \+= \"§ion_name=\" \+ GWO_section_name_name;/
|
24
|
+
gwo_start("gwo_id", "section_name", :ga_tracking => true, :ga_base_url => "http://example.com").should =~ /trackPageView\(\"http:\/\/example\.com\" \+ \"\?ab_test=gwo_id\" \+ google_analytics_info\)/
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should create correct google analytics stuff for several sections" do
|
28
|
-
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"&
|
29
|
-
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"&
|
30
|
-
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"&
|
31
|
-
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /trackPageView\(document.location \+ \"\?ab_test=
|
28
|
+
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"§ion_name1=\" \+ GWO_section_name1_name;/
|
29
|
+
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"§ion_name2=\" \+ GWO_section_name2_name;/
|
30
|
+
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /google_analytics_info \+= \"§ion_name3=\" \+ GWO_section_name3_name;/
|
31
|
+
gwo_start("gwo_id", ["section_name1", "section_name2", "section_name3"], :ga_tracking => true).should =~ /trackPageView\(document.location \+ \"\?ab_test=gwo_id\" \+ google_analytics_info\)/
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moviepilot-gwo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
@@ -33,7 +33,6 @@ files:
|
|
33
33
|
- rails/init.rb
|
34
34
|
has_rdoc: true
|
35
35
|
homepage: http://github.com/kesselborn/gwo
|
36
|
-
licenses:
|
37
36
|
post_install_message:
|
38
37
|
rdoc_options:
|
39
38
|
- --line-numbers
|
@@ -55,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
54
|
requirements: []
|
56
55
|
|
57
56
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.
|
57
|
+
rubygems_version: 1.2.0
|
59
58
|
signing_key:
|
60
59
|
specification_version: 2
|
61
60
|
summary: Plugin to easily make use of Server-Side Dynamic Section Variations with Google Web Optimizer
|