Answer the question
In order to leave comments, you need to log in
What is an alternative way to set Yandex goals?
Hello, my sites (wordpress) have JS event targets on buttons, but the code disappears from time to time.
Most likely, the engine itself auto-formats the code, since such code is not clear to it.
Here is the code I put in:
<a onclick="ym(20084554, 'reachGoal', 'tel'); return true;" href="tel:+7812 331 17 xx">+7 (812) 331-17-xx </a>
Answer the question
In order to leave comments, you need to log in
<a class="ym-trigger" href="tel:+7812 331 17 xx">+7 (812) 331-17-xx </a>
window.onload = function () {
document.querySelectorAll('.ym-trigger').forEach(function ($el) {
$el.addEventListener('click', function () {
window.ym(20084554, 'reachGoal', 'tel');
});
});
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question