M
M
Max Poll2018-05-12 14:03:19
MODX
Max Poll, 2018-05-12 14:03:19

What is the best way to organize the transfer of the target ID from the modx ajax form to the metric?

What is the best way to send the target ID from yaCounterXXXXXX.reachGoal('TARGET_NAME') ?
If placed on the onclick or onsubmit events, then the submission occurs regardless of whether the user filled out the form correctly or not. Now I made a call to the yaCounterXXXXXX function in &successMessage. But I would like a more aesthetic solution. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2018-05-17
@Max Poll

$(document).on('af_complete', function(event, response) {
  var form = response.form;
  if (response.success) {
    yaCounter********.reachGoal('ZABRONIR');
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question