<script> 
 (function(document){
    function populateForms(){
      if (document.readyState == 'interactive') {
        if (document.forms.length !== 0 && location.search) {
          var query = location.search.substr(1);
          query.split('&').forEach(function (part) {
            if (part.indexOf('=') !== -1) {
              var item = part.split('=');
              var key = item[0];
              var value = decodeURIComponent(item[1]);
              var inputs = document.querySelectorAll('*[name^="mauticform[' + key + ']"');
              inputs.forEach(function (input) {
                if(input.type==='checkbox' && input.value===value){
                  input.checked=1;
                } else {
                  input.value = value;
                }
              });
            }
          });
        }
      }
    }
    document.addEventListener('readystatechange',populateForms);
    populateForms();
  }(document));
</script>