optimize_ab 0.0.7 → 0.0.8
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/optimize_ab/helpers.rb +11 -16
- data/lib/optimize_ab/version.rb +1 -1
- metadata +1 -1
data/lib/optimize_ab/helpers.rb
CHANGED
|
@@ -71,24 +71,21 @@ module Helpers
|
|
|
71
71
|
####################################################################
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
########
|
|
74
|
+
######## Control / Tracking Script / Click Function ########
|
|
75
75
|
|
|
76
76
|
def multi_head(k, ua, pv)
|
|
77
77
|
js = <<-HTML
|
|
78
|
-
<!-- Google Website Optimizer Control Script -->
|
|
79
78
|
<script>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</script
|
|
90
|
-
<!-- End of Google Website Optimizer Control Script -->
|
|
91
|
-
<!-- Google Website Optimizer Tracking Script -->
|
|
79
|
+
function utmx_section(){}function utmx(){}
|
|
80
|
+
(function(){var k="#{k}",d=document,l=d.location,c=d.cookie;function f(n){
|
|
81
|
+
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return escape(c.substring(i+n.
|
|
82
|
+
length+1,j<0?c.length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
|
|
83
|
+
d.write('<sc'+'ript src="'+
|
|
84
|
+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
|
|
85
|
+
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
|
|
86
|
+
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
|
|
87
|
+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
|
|
88
|
+
</script>
|
|
92
89
|
<script type="text/javascript">
|
|
93
90
|
var _gaq = _gaq || [];
|
|
94
91
|
_gaq.push(['gwo._setAccount', "#{ua}"]);
|
|
@@ -100,14 +97,12 @@ module Helpers
|
|
|
100
97
|
}
|
|
101
98
|
catch(err){}
|
|
102
99
|
}
|
|
103
|
-
|
|
104
100
|
(function() {
|
|
105
101
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
106
102
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
107
103
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
108
104
|
})();
|
|
109
105
|
</script>
|
|
110
|
-
<!-- End of Google Website Optimizer Tracking Script -->
|
|
111
106
|
HTML
|
|
112
107
|
return js.html_safe
|
|
113
108
|
end
|
data/lib/optimize_ab/version.rb
CHANGED