optimize_ab 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,32 @@
1
1
  module Helpers
2
- def foobar
3
- 'Hi'
2
+ def ab_head
3
+ js = <<-HTML
4
+ <!-- Google Website Optimizer Control Script -->
5
+ <script>
6
+ function utmx_section(){}function utmx(){}
7
+ (function(){var k='3270946421',d=document,l=d.location,c=d.cookie;function f(n){
8
+ if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return escape(c.substring(i+n.
9
+ length+1,j<0?c.length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
10
+ d.write('<sc'+'ript src="'+
11
+ 'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
12
+ +'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
13
+ +new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
14
+ '" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
15
+ </script><script>utmx("url",'A/B');</script>
16
+ <!-- End of Google Website Optimizer Control Script -->
17
+ <!-- Google Website Optimizer Tracking Script -->
18
+ <script type="text/javascript">
19
+ var _gaq = _gaq || [];
20
+ _gaq.push(['gwo._setAccount', 'UA-29835325-2']);
21
+ _gaq.push(['gwo._trackPageview', '/3270946421/test']);
22
+ (function() {
23
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
24
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
25
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
26
+ })();
27
+ </script>
28
+ <!-- End of Google Website Optimizer Tracking Script -->
29
+ HTML
30
+ return js
4
31
  end
5
32
  end
@@ -1,3 +1,3 @@
1
1
  module OptimizeAb
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimize_ab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: