Answer the question
In order to leave comments, you need to log in
How to set up a goal script in Ya.Metrika and Google Analytics?
Good day!
I found a script on the Internet, I can’t get it to work, because. I don't know js.
//Goals for Yandex.Metrica and Google Analytics
$(".button").on("click", (function() {
ga("send", "event", "goal", "goal");
yaCounterXXXXXXXX. reachGoal("goal");
return true;
}));
HTML:
< div class="button_wrap">
< button class="button">Order < /button>
div>
XXXXXXXX is the goal counter
- goal identifier.
Answer the question
In order to leave comments, you need to log in
XXXXXXXX - replace with your counter number.
In the metric, write down the goal with the identifier goal.
What doesn't work?
UPD
And put the counters on the page yourself)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question