<commit_before>var variants = {
    "rootnode": ".article-container .inner",
    "variants": [
        {
            'url': "www.gov.uk/driving-transaction-finished-v1",
            'analytics': "variant-1",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=1" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=1" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v2",
            'analytics': "variant-2",
             'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=2" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=2" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v3",
            'analytics': "variant-3",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p class="organ-donor-photo">Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=3" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=3" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v4",
            'analytics': "variant-4",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p class="organ-donor-logo">Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=4" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=4" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v5",
            'analytics': "variant-5",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>Three people die every day because there are not enough organ donors.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=5" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=5" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v6",
            'analytics': "variant-6",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>You could save or transform up to 9 lives as an organ donor.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=6" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=6" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v7",
            'analytics': "variant-7",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>If you needed an organ transplant would you have one? If so please help others.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=7" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=7" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v8",
            'analytics': "variant-8",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>If you support organ donations please turn your support into action.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=8" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=8" title="Learn more about organ donation">Learn more</a></p>'
            
        }         
    ]
};




(function () {
  "use strict"
  var root = this,
      $ = root.jQuery;

  if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }

  var multivariateTest = {
    init: function(variations){
      var id = multivariateTest.randomSelect(variations.variants.length);

      multivariateTest.updateContent(variations.variants[id].content, variations.rootnode);

      multivariateTest.sendData(variations.variants[id].analytics);
    },

    randomSelect: function(total){
    	return Math.floor(Math.random() * (total));
    },

    updateContent: function(content, rootnode){
      $(rootnode).html(content);
    },

    sendData: function(analytics){
      _gaq.push(["_setCustomVar",12,"organ donation",analytics,3]); 	
    }
  }
  root.GOVUK.multivariateTest = multivariateTest;
}).call(this);


if($(".completed_transaction").length != 0){
  GOVUK.multivariateTest.init(variants);
}
<commit_msg>Only test one element<commit_after>var variants = {
    "rootnode": ".article-container .inner",
    "variants": [
        {
            'url': "www.gov.uk/driving-transaction-finished-v1",
            'analytics': "variant-1",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=1" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=1" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v2",
            'analytics': "variant-2",
             'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=2" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=2" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v3",
            'analytics': "variant-3",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p class="organ-donor-photo">Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=3" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=3" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v4",
            'analytics': "variant-4",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p class="organ-donor-logo">Every day thousands of people who see this page decide to register.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=4" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=4" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v5",
            'analytics': "variant-5",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>Three people die every day because there are not enough organ donors.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=5" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=5" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v6",
            'analytics': "variant-6",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>You could save or transform up to 9 lives as an organ donor.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=6" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=6" title="Learn more about organ donation">Learn more</a></p>'
            
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v7",
            'analytics': "variant-7",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>If you needed an organ transplant would you have one? If so please help others.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=7" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=7" title="Learn more about organ donation">Learn more</a></p>'
        },
        {
            'url': "www.gov.uk/driving-transaction-finished-v8",
            'analytics': "variant-8",
            'content': '<div class="summary"><p>Finally, please join the Organ Donor Register.</p></div><p>If you support organ donations please turn your support into action.</p><p><a rel="external" href="https://www.organdonation.nhs.uk/how_to_become_a_donor/registration/consent.asp?campaign=2244&v=8" title="Register to become an organ donor" class="button">Join now</a> or <a rel="external" href="http://www.organdonation.nhs.uk/how_to_become_a_donor/questions/index.asp?campaign=2244&v=8" title="Learn more about organ donation">Learn more</a></p>'
            
        }         
    ]
};




(function () {
  "use strict"
  var root = this,
      $ = root.jQuery;

  if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }

  var multivariateTest = {
    init: function(variations){
      var id = multivariateTest.randomSelect(variations.variants.length);

      multivariateTest.updateContent(variations.variants[id].content, variations.rootnode);

      multivariateTest.sendData(variations.variants[id].analytics);
    },

    randomSelect: function(total){
    	return Math.floor(Math.random() * (total));
    },

    updateContent: function(content, rootnode){
      $(rootnode).first().html(content);
    },

    sendData: function(analytics){
      _gaq.push(["_setCustomVar",12,"organ donation",analytics,3]); 	
    }
  }
  root.GOVUK.multivariateTest = multivariateTest;
}).call(this);


if($(".completed_transaction").length != 0){
  GOVUK.multivariateTest.init(variants);
};
{'fraction_non_alphanumeric': 0.16355788500077076, 'fraction_numerical': 0.015569600739941422, 'mean_word_length': 3.907337367624811, 'pattern_counts': {'":': 4, '<': 191, '<?xml version=': 0, '>': 191, 'https://': 16, 'lorem ipsum': 0, 'www.': 48, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2545242', 'n_tokens_mistral': 4417, 'n_tokens_neox': 4080, 'n_words': 787}