P
P
Prosto_ya822018-02-19 12:40:49
Yandex.Metrica
Prosto_ya82, 2018-02-19 12:40:49

What code should be written for the YandexMetrics goal when the send button is clicked?

<form method="post" id="form2">
        <input type="text" name="yourname" placeholder="Ваше имя"  yourbest="true" >
        <input type="tel" name="yourphone" placeholder="Телефон"   yourbest="true" >

        <div align="center" style="padding-top:14px">
        <div class="g-recaptcha" data-sitekey="************************************"></div></div>
        <div id="OTVET" style="display: none;"><!--Ответ формы--></div>
        <input type="button" value="ОСТАВИТЬ ЗАЯВКУ" class="button" onsubmit="yaCounter*********.reachGoal('push_button'); return true;" onclick="AjaxFormRequestSlider('OTVET', 'form2', './form2.php')">
        <div class="blavtors"></div>
        <input type="hidden" name="landingname" value="Заявка">
      </form>

WordPress site + separate html pages. The problem is in the html pages. I can't figure out what I'm doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2018-02-19
@Prosto_ya82

input type="button" - you do not have the 'submit' type, and the very sending of the request is intercepted by Ajax, as far as I understand, it means that you need to insert the goal registration function into the ajax function that processes this form

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question