optimize_ab 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,62 +6,64 @@ http://support.google.com/websiteoptimizer/bin/static.py?hl=en&topic=29622&guide
6
6
 
7
7
  Multi-Variate Control & Tracking Script
8
8
  ---------------------------------------
9
- The control script goes on your test page and makes sure that
10
- the experiment variations are switched randomly and that all
11
- variations are displayed an equal number of times.
9
+ The control script goes on your test page and makes sure that the experiment variations are switched randomly and that all variations are displayed an equal number of times.
12
10
 
13
- The tracking script goes on your test page ensures that visits
14
- to the page are recorded in the experiment.
11
+ The tracking script goes on your test page ensures that visits to the page are recorded in the experiment.
15
12
 
16
- The control script immediately after the <head> tag.
13
+ The control script immediately after the head tag.
17
14
 
18
- mv_head(k, ua, pv)
15
+ mv_head(k, ua, pv, gv)
19
16
 
20
- Arguements can be taken directly form the Google Optimize Website Script code
17
+ k: the value listed in the control script:
21
18
 
19
+ {var k="#{k}" # Example: 262340015
20
+
21
+ ua: the Account number listed in control script:
22
+
23
+ _gaq.push(['gwo._setAccount', 'ua']); # Example: UA-46835225-6
24
+
25
+ pv: the track page view link listed in control script:
26
+
27
+ _gaq.push(['gwo._trackPageview', '/pv/test']); # Example: 6234623
22
28
 
23
29
  Multi-Variate Page Sections Scripts
24
30
  ---------------------------------------
25
31
  The page sections script is used to mark
26
- the elements that will be varied during the experiment.
27
- Essentially, you need to use the script provided by Website
28
- Optimizer to define the beginning and end of each element. For
29
- each element, you will need to name the page section in the script.
30
- As an example, let's say you defined a header that welcomes
31
- people to your page. The starting HTML code looks like this:
32
+ the elements that will be varied during the experiment. Essentially, you need to use the script provided by Website Optimizer to define the beginning and end of each element. For each element, you will need to name the page section in the script. As an example, let's say you defined a header that welcomes people to your page. The starting HTML code looks like this:
32
33
 
33
- <h1>Welcome!</h1>
34
+ <h1>Welcome!</h1>
34
35
 
35
36
  After adding your section script, the header will look like this
36
37
  (with the custom name "Headline" for this section in italics):
37
38
 
38
- <h1>
39
- <%= mv_begin_section("Headline") %>
40
- Welcome!
41
- <%= mv_end_section %>
42
- </h1>
39
+ <h1>
40
+ <%= mv_begin_section("Headline") %>
41
+ Welcome!
42
+ <%= end_section %>
43
+ </h1>
43
44
 
44
45
  in HAML a link might be written as:
45
46
 
46
- = link_to (mv_begin_section('Headline') + "Welcome" + mv_end_section)
47
+ = link_to (mv_begin_section('Headline') + "Welcome" + mv_end_section)
47
48
 
48
49
 
49
- OnClick Conversion
50
+ Conversions Javascript function
50
51
  ---------------------------------------
51
- You'll need to add a snippet of text to the link or links
52
+ Conversions are initiated via a javascript function 'doGoal'
53
+ You'll need to add a snippet of text to the link / links
52
54
  that you want to track as a conversion. Let's say your link
53
55
  looks like this:
54
56
 
55
- <a href="http://www.example.com/promotion">Featured Products</a>
57
+ <a href="http://www.example.com/promotion">Featured Products</a>
56
58
 
57
59
  To count a conversion when this link is clicked, add:
58
60
 
59
- onclick="doGoal(this);return false;"
61
+ onclick="doGoal(this);return false;"
60
62
 
61
63
  to the HTML tag. The new link will look like this
62
64
  (addition in bold):
63
65
 
64
- <a href="http://www.example.com/promotion" onclick="doGoal(this);return false;">Featured Products</a>
66
+ <a href="http://www.example.com/promotion" onclick="doGoal(this);return false;">Featured Products</a>
65
67
 
66
68
  You can modify as many links as you want to count as a conversion,
67
69
  but all of them will be counted identically as conversions in your
@@ -18,10 +18,10 @@ module Helpers
18
18
  <script type="text/javascript">
19
19
  var _gaq = _gaq || [];
20
20
  _gaq.push(['gwo._setAccount', "#{ua}"]);
21
- _gaq.push(['gwo._trackPageview', "#{pv}"]);
21
+ _gaq.push(['gwo._trackPageview', "#{'/' + pv.to_s + '/test'}"]);
22
22
  function doGoal(that) {
23
23
  try {
24
- _gaq.push(['gwo._trackPageview', "#{pv}"]);
24
+ _gaq.push(['gwo._trackPageview', "#{'/' + pv.to_s + '/goal'}"]);
25
25
  setTimeout('document.location = "' + that.href + '"', 100)
26
26
  }
27
27
  catch(err){}
@@ -1,3 +1,3 @@
1
1
  module OptimizeAb
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
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.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: