<!-- Load the Content Experiment JavaScript API client for the experiment -->
<script src="//www.google-analytics.com/cx/api.js?experiment=ИДЕНТИФИКАТОР_ЭКСПЕРИМЕНТА"></script>
<!-- Load the JQuery library -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script>
// Ask Google Analytics which variation to show the user.
var chosenVariation = cxApi.chooseVariation();
// Define JavaScript for each page variation of this experiment.
var pageVariations = [
function() {
}, // Original: Do nothing. This will render the default HTML.
function() {
document.location.href = 'http://web-analytics.me/variant2.html';
},
function() {
document.location.href = 'http://web-analytics.me/variant3.html';
}
];
// Wait for the DOM to load, then execute the view for the chosen variation.
$(document).ready(
//JQuery(document).ready(
// Execute the chosen view
pageVariations[chosenVariation]
);
</script>
function() {
document.location.href = 'http://web-analytics.me/variant2.html';
},
function() {
document.location.href = 'http://web-analytics.me/variant3.html';
}
function() { // Variation 1: Banner Image
document.getElementById('banner').src = 'bay-bridge.jpg';
},
function() { // Variation 2: Sub-heading Text
document.getElementById('heading').innerHTML = 'Look, a Bridge!';
},
function() { // Variation 3: Button Text
document.getElementById('button').innerHTML = 'Learn more';
},
function() { // Variation 4: Button Color
document.getElementById('button').className = 'button button-blue';
}