Stacy Fleetwood

Blogger, Internet Marketer, and All Around Smartass

A/B Split Test Tutorial

split test tutorialThis A/B split test tutorial was written under the assumption that you already know the benefits of split testing, so I won’t spend any time going over the reasons why you should track and test.  This information regarding split tests was created to walk you through the process of setting up the test through Google Analytics and to point out the issues that I had and the workarounds or resolutions that I came up with to get everything lined up and working.

 

Some Background on My First Experience Setting Up a Split Test

Setting up the split test turned out to be a gigantic pain in the rear.  It does not have to be that way for you because in this post I will go over all of the issues I ran into and how I got through them.  It took me several days, considering I only get a few hours a day to work on this business, to work through all of this.

 

The Need to Create a Subdomain for My Squeeze Pages

Squeeze pages need to be super clean with no menus, footers, social media icons, etc., therefore these pages typically can’t be built simply by adding some images and content to a page within your current theme.  That is the problem that I had with my old squeeze page.  I could not get rid of the header and footer that comes with the theme page template.

I know that there are probably plenty of ways to accomplish this, but I am not a programmer so I need a method that is as cut and dry as possible.  I’m not trying to cut corners by any means, but I have to work with my own threshold of knowledge here.  With that being said, I am sure that there is a way to create a custom page template that can be used in your current theme, but building/coding something like that is way out of my league.

For me, it was simpler to add a subdomain and just use an FTP client to upload html squeeze pages right to the subdomain directory.  See the example breakdown below:

Main domain – example.com
Subdomain – offers.example.com
Squeeze page 1 – offers.example.com/squeeze1
Squeeze page 2 – offers.example.com/squeeze2

 

How to Create a Subdomain

You will need to check with your hosting provider for how to set up a subdomain.  It should be pretty straightforward.  Below I have linked to instructions from the following host providers:

Godaddy

Hostgator or and cPanel interface host provider

 

Squeeze Page Templates

squeezesample

Now that you have a home for your squeeze pages, how will you generate them?  There are plenty of places where you can buy html squeeze pages online, and there are some awesome freebies out there too.  Check out the following free squeeze page templates:

Viperchill’s Ultimate Squeeze Page Template

300 Free Squeeze Page Templates

When you are looking at free or paid templates, keep in mind you will need to integrate your autoresponder.  Some templates are already integrated with Aweber or GetResponse and all you need to do is switch out fields like list name and confirm URL with your own.  If you choose one that isn’t integrated then you will have some research to do to figure out how to integrate the code yourself.  It’s best that you know that up front.

 

How to Edit and Customize a Squeeze Page Template

You will need an html editor in order to edit an html page.  I use the Free NVU html editor.  It was intuitive and easy to use.  It’s a WYSIWYG (What You See Is What You Get) web page editor so it’s very easy to use for those of us non-technical folks.   See below screenshot examples:

This is the Normal view.  It’s your WYSIWYG editor.  You can click in this screen and change verbiage, format text, add links, etc.  It’s very much like WordPress’s ‘Visual’ editing tab.

NVUnormal

This is the Source view.  This is your code, and is like the ‘Text’ tab of the WordPress editing screen.  Here is where you will add things like Google Analytics code and customize the autoresponder code.

NVUsource

 

Setting Up Your Squeeze Pages for the Experiment

You need to test one thing at a time, like your headline, or an image or the verbiage on your call to action button.  Don’t use two drastically different squeeze pages for the test or you will not know what it is that increases or decreases the conversion rate.  The whole point of the test is to learn what your target market responds to.

For an A/B test in Google Analytics you will need to create an ‘Original’ and a ‘Variation’.  You will input the URLs for each into your GA experiment and Google will split your traffic up between each page and record the results for each.

I will get into more details on setting up the experiment in GA later, for now just be sure that you have a squeeze page, and a variation of that squeeze page.  You can find an example of my original and variation on Day 46 – 90 Day Blog Challenge – Split Testing.

 

Autoresponder Code

Hopefully your template is as cool as mine, and has something like < — Autoresponder Code Starts Here — >.  Once you have identified the code, you will need to look for where you can identify your list and your redirect URL (the page you want to person to be directed to once they hit download now, or whatever your call to action happens to be).  I use Aweber, so I had to find the following code:

<input name=”listname” value=”list name” type=”hidden”>

<input name=”redirect” value=”your confirm url
type=”hidden”>

I replaced the bold text with my list and URL info.

 

Uploading the Page/s to Your Subdomain

This part was actually fairly easy.  I used the FTP client Filezilla to upload the folder containing the html page, images, and style sheet.  If you are using an FTP client be sure to have your host IP, and directory username and password.  A great video for uploading to your Godaddy hosting account using Filezilla can be found here.

 

A Few Pointers on Uploading Your HTML Pages

Don’t make the mistake of trying to upload just the html page.  You need to have a folder containing the html page and any images and style sheets that are used on the page.  Upload the whole folder.

Also, keep in mind when you name the folder and the html page that these will be in the URL for the page.  For example, a folder named ‘List Building’ and page named ‘Best List Building Technique’ will appear like this:

offers.example.com/list-building/best-list-building-technique.html

 

frustration-scaled1000Setting Up the Experiment in Google Analytics

The article I referenced in Day 46 – 90 Day Blog Challenge – Split Testing about how to do A/B split testing does walk you through the process in great detail.  I hit a snag, however, when trying to validate the Google code both for Google Analytics and for the experiment itself.  This snag is what took me several days to resolve. I believe I used every four letter word in the book during that ordeal.  I did figure out a way to work it out, so I learned something.

 

Setting Up Google Analytics For a Subdomain

My first mistake was not realizing that the GA code that was already on my site did not just magically appear on the new html pages now on my subdomain.  The next issue was that I couldn’t use the same code that I had used on my main site on the subdomain.  I had to modify that code to identify the primary domain name.  I found several sites that each offered some sort of code that was supposed to accomplish this, but nothing helped.  Here is what I ended up doing:

I logged into GA and created a new property using Classic Analytics and entered the URL of my primary domain.  When inputting information about the site to generate a tracking code script I turned on ‘Subdomains’.  I then copied the script containing a new tracking ID (UA-XXXXXXXX-XX)  into notepad.  The purpose for this whole exercise was to get GA itself to generate the code necessary to identify my primary domain.  Now, I just had to remove the new tracking ID and replace it with my current one, so I would not lose any of my GA history and I could have a subdomain on my current GA account for this site.

I put this new version of the GA tracking script into my main site, as well as onto the new html pages that reside in my subdomain.

 

The Experiment Code

You will also need to place code for the experiment on each page that will be tested (your original and variation pages).  That code will look something like this:

<!– Google Analytics Content Experiment code –>
<script>function utmx_section(){}function utmx(){}(function(){var
k=’XXXXXXXX-X’,d=document,l=d.location,c=d.cookie;
if(l.search.indexOf(‘utm_expid=’+k)>0)return;
function f(n){if(c){var i=c.indexOf(n+’=');if(i>-1){var j=c.
indexOf(‘;’,i);return escape(c.substring(i+n.length+1,j<0?c.
length:j))}}}var x=f(‘__utmx’),xx=f(‘__utmxx’),h=l.hash;d.write(
‘<sc’+'ript src=”‘+’http’+(l.protocol==’https:’?'s://ssl’:
‘://www’)+’.google-analytics.com/ga_exp.js?’+'utmxkey=’+k+
‘&utmx=’+(x?x:”)+’&utmxx=’+(xx?xx:”)+’&utmxtime=’+new Date().
valueOf()+(h?’&utmxhash=’+escape(h.substr(1)):”)+
‘” type=”text/javascript” charset=”utf-8″><\/sc’+'ript>’)})();
</script><script>utmx(‘url’,'A/B’);</script>
<!– End of Google Analytics Content Experiment code –>

This code needs to be pasted into your test pages after the opening head tag – <head>.

 

Extra Code May Be Necessary

I got the following error when I tried to validate the experiment code:

‘Experiment code missing the cookie domain name declared in tracking code’

I found and tested many scripts that were said to eliminate this issue, and finally one worked.  If you get this error, try adding the following code before your experiment code:

<script>
_udn = “example.com”;
</script>

Also, be sure to put this code after the <!– Google Analytics Content Experiment code –> label.

It should look like this:

<!– Google Analytics Content Experiment code –>
<script>
_udn = “example.com”;
</script>
<script>function utmx_section(){}function utmx(){}(function(){var

With the rest of the lines of your experiment code following.  After making this change to the code, and uploading the newest version of html pages to my subdomain my pages validated and I am now ready to send traffic to my test.

 

Split Test Tutorial Summary

So that about wraps up my experience with setting up a split test with Google Analytics.  If you have any questions please feel free to post a comment, or email me.  If you found the split test tutorial beneficial, or have some experience with split testing that you would like to share please leave a comment.

Send to Kindle

4 Responses to “A/B Split Test Tutorial”

  1. Julia says:

    this is fantastic! thanks

    • Stacy says:

      Julia,

      Thank you! I tried my best to take something that has a lot of steps that could sound complicated, and make it as straightforward as possible.

      I am actually doing another split test this weekend. I am doing testing two variations this time. I’ll do this by keeping my original page that is getting me a consistent 40+ percent conversion, and I’ll change one thing and create variation page 1, and then I’ll take that original page and change one thing and create variation page 2. So, GA will split my traffic among three pages, and I’ll see which variation does best.

      I’ll be posting about it soon!

      Stacy

  2. Steven Lucas says:

    This is one of those “Why didn’t I find this earlier” blogs. You’d have saved me a ton of heartache and reminded me of so many other things I needed to do. Never mind. You’ve commented on my efforts and been very kind about them.

    I’ll certainly be back here to learn far more than my mind can encompass, but then again it may help to push out some of the rubbish I know as well.

    Regards,

    Steven Lucas

    • Stacy says:

      Steven,

      Thank you very much! I can’t tell you how much this statement “You’d have saved me a ton of heartache and reminded me of so many other things I needed to do” means to me. This was one of the main reasons for documenting my efforts in the way that I did.

      I have been kind of quiet on the blog for a few months now. I am going to be posting about why, and what is to come. So, look out for the new stuff coming. I will be looking back over the 90 day challenge and explaining how and why I lost focus, why I burned out soon after the end of the 90 days, and what I have been up to in the last 6 months to regain focus and create the strongest mindset I have ever had. I cannot wait to share it all, because I know it will help people who are trying to undertake the same endeavor – to get from A (current lifestyle) to B (sustainable financial freedom).

      Keep working smart Steven, you are making great strides even if it doesn’t feel like it right now.

      Thanks for coming by!

      Stacy

Back to Top