Google Website Optimizer v 1.0 The Techie Guide User Manual
Page 24

24
The Techie Guide to Google Website Optimizer
Other Advanced Stuff
Add JavaScript tags to experiment pages
This is Step 2 of the Website Optimizer tool provides the specific code to install on your pages.
For your original page:
1. Add both the Control Script and the Tracking script as described in the tagging instructions.
2. Ignore the instructions under Page sections, and instead add the following script, exactly as it
appears below, immediately after the Control Script:
<!-- utmx section name=”Test URL” -->
<script>
var b = utmx(‘variation_content’, ‘Test URL’);
function filter(v) {
var u = v[0].contents;
if (b && u.substr(0,7) == ‘http://’ && b.substr(0, 7) != ‘http://’) {
u = u.substr(7);
}
return u;
}
utmx(‘url’, ‘Test URL’, 0, filter);
</script>
3. The filter function exists to strip off the ‘http://’ which the utmx function might prepend to the URL.
This allows one to redirect to relative URL’s.
For alternative pages (B, C, and other pages):
Add the Tracking Script as described in the tagging instructions.
For your conversion page:
Add the Conversion Script to your conversion page, at the very end of your source code (after the closing
</body> tag) as described in the tagging instructions.
Once the process of tagging your pages is finished, click
Validate pages. If your pages aren’t accessible, click
Try offline validation to upload your pages directly into Website Optimizer.
Click
Continue to move on to Step 3.
Create Variations
In Step 3 of the Website Optimizer tool:
1. Click
Add new variation.
2. Enter a name for this variation and click
Add.
3. In the text box, enter the URL for alternative page for this variation. This should be on a single line
with no additional whitespace before or after the URL..
4. Click
Save.
5. Click
Preview - Website Optimizer will display your variation page.
6. Repeat the steps above for any additional variation pages (your C, D, and other pages).
7. Click
Save and continue to move to Step 4.