A
A
anton99992020-08-06 12:52:33
Yandex.Metrica
anton9999, 2020-08-06 12:52:33

How to add a target (javascript event) Yandex metrics to a button?

there is a php code where the button is displayed. can't insert code onclick="yaCounterXXXXX.reachGoal('NNNNNN'); return true;">. error writes. Tell me how it will be right?
here is the code

echo '<div class="zn_submit_container ' . 'text-' . $this->opt( 'btn_alignment', 'left' ) . '"><button class="zn_contact_submit btn ' . implode( ' ', $btn_classes) . '" type="submit">' . $submit_label . '</button></div>';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashok Doom, 2020-08-06
@anton9999

echo '<div class="zn_submit_container ' . 'text-' . $this->opt( 'btn_alignment', 'left' ) . '"><button onclick="yaCounterXXXXX.reachGoal(\'NNNNNN\'); return true;" class="zn_contact_submit btn ' . implode( ' ', $btn_classes) . '" type="submit">' . $submit_label . '</button></div>';

Try to escape

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question