U
U
Uber Noob2016-08-14 23:10:11
Analytics
Uber Noob, 2016-08-14 23:10:11

How to set a goal in Yandex Metrica?

On the page https://yandex.ru/support/metrika/reports/add-goals.xml to the JavaScript goal an example:

<html>
    ...
    <form action="" method="get" onsubmit="yaCounterXXXXXX.reachGoal('ORDER', function () {
    alert('Данные успешно отправлены');
}, <Контекст, доступный по ключевому слову this внутри callback-функции>); return true;">
        ...
    </form>
    ...
</html>

1. What to write instead of alert('Data sent successfully') if I don't need any notification
2. I don't understand what the Context is, available by the this keyword inside the callback function...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Kravchenko, 2016-08-15
@AntonKravchenko

for a simple goal,
onsubmit="yaCounterXXXXXX.reachGoal('ORDER'); return true;"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question