Answer the question
In order to leave comments, you need to log in
How to correctly register Yandex target event on a regular button?
I can’t figure out how to correctly write the goal-event for the Yandex metric in the button code. Here's a screencap of the code:
<div id="mk-button-11" class="mk-button-container _ relative mk-animate-element flip-x block text-center twf mk-in-viewport">
<a href="#" target="_self" class="mk-button js-smooth-scroll mk-button--dimension-flat mk-button--size-large mk-button--corner-pointed text-color-dark _ relative text-center font-weight-700 no-backface letter-spacing-2 inline">
<span class="mk-button--text">ПОЛУЧИТЬ БИЛЕТ</span>
</a>
</div>
onclick="yaCounter39276445.reachGoal('buyclick');
Answer the question
In order to leave comments, you need to log in
If the button is a link, then in the link attributes.
<div id="mk-button-11" class="mk-button-container _ relative mk-animate-element flip-x block text-center twf mk-in-viewport">
<a onclick="yaCounter39276445.reachGoal('buyclick');" href="#" target="_self" class="mk-button js-smooth-scroll mk-button--dimension-flat mk-button--size-large mk-button--corner-pointed text-color-dark _ relative text-center font-weight-700 no-backface letter-spacing-2 inline">
<span class="mk-button--text">ПОЛУЧИТЬ БИЛЕТ</span>
</a>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question