J
J
jeka-32021-04-07 17:22:27
JavaScript
jeka-3, 2021-04-07 17:22:27

How to add a Yandex Metrica goal to a button using js?

How to add a Yandex Metrica goal to a button using js?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kudrya, 2021-04-07
@jeka-3

Add a class and a date attribute with a target to the button, and in js, when you click on a btn with a class, just call the desired method with the target that was in the date attribute.
You can set at least 200 different targets, everyone will work out

I
Il'ia Kartovitskii, 2021-04-07
@kartovitskii

<button onclick="// тут вызов функции">Кнопка</button>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question