Among the many virtues of Content Experiments discussed in yesterday’s post was ease of setup. As long as your original, variation, and goal pages contain the Google Analytics tracking code, all that’s required for a Content Experiment is a single code snippet on the original page.
The issue is the positioning of this code within the page’s HTML. You’re instructed to place it immediately after the opening <head> tag. That’s easy to do if you happen to be working with a standlone HTML page, but since most websites are based on templates that provide the <head> tag for all pages, it’s often difficult to customize its contents for individual pages.
You should keep in mind that the pageviews for the original page may be inflated if the tracking code executes in the original page before the experiment code is reached. When this happens, Google Analytics will record a pageview both for the original page, even though the visitor will probably never see it the browser, and for any variation page that the experiment code redirects to and the visitor does see.
This potential skewing of data for the original page, however, is more than offset by the benefits you’ll reap from testing, so don’t let error messages about code placement thwart your Content Experiments. Skip validation if you need to, forge ahead, and start making better design decisions with A/B testing.