<commit_before>function donateButtonTextVariant(variant) {
  if (variant === '0') {
      $(document).ready(function(){
        $('.donate-cta__button').text('Donate now');
      });
  } else if (variant === '1') {
    $(document).ready(function(){
      $('.donate-cta__button').text('Donate £5 now');
    });
  } else if (variant === '2') {
    $(document).ready(function(){
      $('.donate-cta__button').text('Donate £10 now');
    });
  }
};

if ( typeof dataLayer === 'object' && typeof gtag === 'undefined' ) {
  // https://support.google.com/optimize/answer/9059383
  function gtag() { dataLayer.push(arguments); };
}

if ( typeof gtag !== 'undefined' ) {
  gtag('event', 'optimize.callback', {
    name: 'XinKUWDjTuK7Yxyo3ZBS4g',
    callback: donateButtonTextVariant
  });
}

$(function(){
  // Record an event whenever the donation button is clicked.
  $('.donate-cta__button').on('click', function(){
    if( typeof ga !== 'undefined' && ga.loaded ){
      e.preventDefault();
      var href = $(this).attr('href');
      ga('send', {
        hitType: 'event',
        eventCategory: 'Request page donate button',
        eventAction: 'click',
        eventLabel: document.title,
        hitCallback: function() {
          window.location.href = href;
        }
      });
    }
  });
});
<commit_msg>Pass event parameter to donate button click handler<commit_after>function donateButtonTextVariant(variant) {
  if (variant === '0') {
      $(document).ready(function(){
        $('.donate-cta__button').text('Donate now');
      });
  } else if (variant === '1') {
    $(document).ready(function(){
      $('.donate-cta__button').text('Donate £5 now');
    });
  } else if (variant === '2') {
    $(document).ready(function(){
      $('.donate-cta__button').text('Donate £10 now');
    });
  }
};

if ( typeof dataLayer === 'object' && typeof gtag === 'undefined' ) {
  // https://support.google.com/optimize/answer/9059383
  function gtag() { dataLayer.push(arguments); };
}

if ( typeof gtag !== 'undefined' ) {
  gtag('event', 'optimize.callback', {
    name: 'XinKUWDjTuK7Yxyo3ZBS4g',
    callback: donateButtonTextVariant
  });
}

$(function(){
  // Record an event whenever the donation button is clicked.
  $('.donate-cta__button').on('click', function(e){
    if( typeof ga !== 'undefined' && ga.loaded ){
      e.preventDefault();
      var href = $(this).attr('href');
      ga('send', {
        hitType: 'event',
        eventCategory: 'Request page donate button',
        eventAction: 'click',
        eventLabel: document.title,
        hitCallback: function() {
          window.location.href = href;
        }
      });
    }
  });
});

{'fraction_non_alphanumeric': 0.19287054409005627, 'fraction_numerical': 0.01200750469043152, 'mean_word_length': 2.9672619047619047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '6622249', 'n_tokens_mistral': 861, 'n_tokens_neox': 841, 'n_words': 171}