A
A
Andrej Sharapov2018-10-18 13:24:28
JavaScript
Andrej Sharapov, 2018-10-18 13:24:28

How to set up goals in Yandex.Metrica?

Hello.
Tell me how to properly set up a compound goal.
1. Go to the contacts page: url: contains/matches with ... it's clear here.
2. Filling out the form and submitting it (WP form - Contact Form 7)
Questions:
a) How to add code to the form itself?

onsubmit="yaCounterXXXXXX.reachGoal('TARGET_NAME'); return true;"

b) What should I write instead of TARGET_NAME ?
c) Do I need to add an id: to the form or the "submit" button?
d) What should be the Condition in the goals? What should be specified in this field (id specified in the form itself or TARGET_NAME)?
A similar question on the spoiler that opens the list with services:
added a click script for a button, but what to write in TARGET_NAME , do I need to write an id for the spoiler and what to put in the Condition field ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrej Sharapov, 2018-10-18
@Madeas

Decided

A
Andrey Goncharov, 2018-10-18
@agmegadeth

reachGoal('TARGET_NAME') is for the event type "javascript event" in the metric. When creating it, you must specify an identifier in the metric, which must be indicated for the TARGET_NAME place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question