Answer the question
In order to leave comments, you need to log in
How to use Yandex.Metrica Form Analytics with an AJAX form?
According to the Yandex.Metrica documentation , the form should be sent on the submit event. I have the following code to submit the form:
<form class="form-horizontal" role="form" id="utsDetails">
...
<button type="button" id="calc" name="calc">Calculate</button>
</form>
<script type="text/javascript">
$("#calc").click(function() {
$.ajax({
type: 'POST',
dataType: 'json',
data: {
// all utsDetails form fields are there
},
beforeSend: function(){
// ...
}
})
.done(function(data, textStatus, jqXHR) {
// ...
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question