What is an A/A test?

An A/A test is an A/B test type where the two variants are identical, and purposes to confirm the testing tool is fair statistically. In Google Optimize terms, no “clear leader” should be identified for an A/A test, but there can be small results differences possible depending on number of experiment sessions (more sessions = closer results).

A/A tests can also be used to determine baseline conversion metrics in general for an original variant with a given testing tool. Even where you are already measuring conversions with an analytics tool like Google Analytics, a testing tool like Google Optimize will measure conversions differently (see “Measuring Google Optimize with Google Analytics“).

What is a server-side test?

With the standard Google Optimize Snippet Installation, JavaScript executed in the browser determines which variant to present. These tests only involve client-side changes (e.g., changing the style or position of an element on a served web page).

With a server-side test, code executed server-side handles all the tasks that Google Optimize handles in a client-side test (e.g., target audiences and serving the right variant to each user). In this scenario, you only use the Optimize tool to create tests, set objectives, create variants, and view reports.

Setup an A/A server-side test

The following details assume:

  • Google Optimize is deployed per option 2 on our “Google Optimize Snippet Installation Best Practices“: “Optimize direct on page, Google Analytics injected via tag management solution“. The tag management solution employed is Google Tag Manager (GTM).
  • You have two independently served versions of your website: one.domain.com (original) and two.domain.com (variant 1).
  • Both website versions have the Google Optimize snippet deployed as noted, with a Google Analytics property view recording activity that can accept hits from both hostnames, and that will be associated with the related Google Optimize experience.

Once you have setup the test in the Google Optimize tool with objectives & variants per the “Server-side Experiments” developer guide, and have obtained the experiment ID, the high level steps that present a variant to a user with a server-side test follow:

  1. A user’s browser requests a URL with hostname one.domain.com.
  2. Server-side executed code on one.domain.com sets a variable to the fixed experiment ID, and uses a random number generator to set a persistent cookie to the variant value (0 for original, 1 for first variant).
  3. A two.domain.com redirect URL variable is set, with URL parameter “utm_expid” appended and assigned to the experiment ID.
  4. A server-side redirect script evaluates the cookie value, and sets the cookies if not already set. If set to 1, the user is redirected per the URL in item 3. If set to 0, the user stays put.
  5. If the user is served two.domain.com, server-side code sets a variable to the same fixed experiment ID, and the variant value to 1.

On both website versions, server-side executed code (PHP in this example) also establishes the GTM data layer using the experiment ID & variant values set (see Optimize snippet instructions option 2 for placement notes).

<!-- Google Optimize - Server Side Experiment dataLayer Push -->
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
	'event': 'optimize-experiment', 
	'optimize-experimentId': '<?php echo $experimentId ?>', 
	'optimize-variationId': '<?php echo $variationId ?>'
});
</script>
Google Analytics

GTM reads these data layer variables, and sets their values to the “expId” and “expVar” fields sent to Google Analytics with pageview & event hits. This enables measuring your Google Optimize server-side test with Google Analytics.

A/A Server-side Test with Google Optimize