Hi there, I'm Pete Koomen, one of the founders of Optimizely, and I can shed some light on how things work from our end. Let's imagine you have a website like and you want to run an experiment on it.
Firstly, you may choose to include your Optimizely account snippet on that page, which will look something like this and remains constant:
<script src="//cdn.optimizely.com/js/XXXXXX.js"></script>
The Optimizely Editor loads in an iframe and uses window.postMessage to communicate with the page. This process only works if the page already has the snippet mentioned above. If not, the editor will time out while waiting for a message from the iframe page and will reload it through a proxy that adds the snippet. This loading method allows the editor to function with pages that have the snippet, don't have it, or are behind a firewall (which requires the snippet).
At this stage, users can make changes to the page using the editor, such as altering text, changing images, or rearranging elements. Each change is recorded as a line of JavaScript like this:
$j("img#hplogo").css({"width":254, "height":112});
|__IDENTIFIER__||____________ACTION______________|
Therefore, a "variation" of a page consists of JavaScript statements that produce the desired changes when executed. If you're interested, you can view and edit this code directly by clicking "Edit Code" in the Optimizely Editor's bottom right corner.
Once you've added the account snippet to the page and initiated the experiment, the JavaScript file linked to by your snippet will assign each visitor to a bucket and execute the relevant JavaScript during page load.
Bucketing visitors and implementing changes promptly during page load involve more intricate processes, but this brief explanation should give you an overview!
Pete