Answer the question
In order to leave comments, you need to log in
Why does the goal in Yandex Metrica not work?
I created javascript goals, hung a couple of goals on links, they work, created another goal for submitting the form, I don’t need clicks on the submit button, namely submitting the form, the form is sent to ajax, so onsubmit will not work either. I call the code directly from the function that fires on completion of the ajax request:
success: function(data) {
yaCounter39003210.reachGoal('SEND_FORM');
modal.close();
success.open();
},
Answer the question
In order to leave comments, you need to log in
I'll answer myself, I found a solution, it's right to do like this:
yaCounter39003210.reachGoal('SEND_FORM', function () {
modal.close();
success.open();
});
in appearance, everything is done correctly (of course, if the counter number is correct and the target is correct)
the metric does not instantly display the triggering of the target, maybe the point is that
in general, insert some console log after the target is triggered to check that this part of the code executed
+ I would probably insert this thing at the end of success, suddenly the metric will disappear, then the modal windows will not close / open after sending
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question