'How to transfer data from a form for Whatsapp to another page before submitting

I created a form in HTML that sends the data to WhstsApp, but I need that before going directly to WhatsApp, go through another page so that I can put the Google Ads conversion code.

Here's a print of the configuration: https://prnt.sc/qlG3cVC_CzjG

Code:

<div class="row register-form">
          <div class="col-md-12">
            <form autocomplete="off">
              <div class="form-group">
                <input
                  type="text"
                  name="Name"
                  id="name"
                  class="form-control"
                  placeholder="Seu Nome *"
                  value=""
                  required=""
                  style="width: 100%;margin-bottom: 5px;"
                />
              </div>
              <div class="form-group">
                <input
                  type="text"
                  name="Email"
                  id="email"
                  class="form-control"
                  placeholder="Seu E-mail *"
                  value=""
                  required=""
                  style="width: 100%;margin-bottom: 5px;"
                />
              </div>
              <div class="form-group">
                <input
                  type="number"
                  name="Phone"
                  id="phone"
                  class="form-control"
                  placeholder="Seu Telefone*"
                  value=""
                  required=""
                  style="width: 100%;margin-bottom: 5px;"
                />
              </div>
              <div class="form-group">
                <select class="form-control" id="service">
                  <option>Motivo do Contato</option>
                  <option>Quero um Orçamento</option>
                  <option>Outros Assuntos</option>
                </select>
              </div>
              <div class="form-group">
                <input
                  type="submit"
                  onclick='gotowhatsapp()'
                  name="submit"
                  id="submit"
                  class="btnSubmit btn-block"
                  value="ENVIAR"
                />
              </div>
            </form>
          </div>
        </div>
      
      

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    function gotowhatsapp() {
    
    var name = document.getElementById("name").value;
    var phone = document.getElementById("phone").value;
    var email = document.getElementById("email").value;
    var service = document.getElementById("service").value;

    var url = "https://wa.me/5511981252689?text=" 
    + "*Nome*: " + name + "%0a"
    + "*Telefone*: " + phone + "%0a"
    + "*E-mail*: " + email  + "%0a"
    + "*Motivo*: " + service; 

    window.open(url, '_blank').focus();
}

How can I make this data go to another page and then redirect to WhatsApp?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source