Answer the question
In order to leave comments, you need to log in
How to add a Yandex metric target to a button in Bitrix?
Hello. They asked me to set a metric and add goals on the site on Bitrix.
But the fact is that there is such a button:
<button class="basket"
onclick='add(<?=$arResult["ID"]?>,<?=$arResult["PREVIEW_PICTURE"]["SRC"]?>)'>Добавить в корзину</button>
Answer the question
In order to leave comments, you need to log in
All. It's just me being a fool. It was necessary to write not 'CART', but "CART" - quotes!
I think this will suit you
<button class="basket"
onclick='yaCounterXXXXXX.reachGoal('CART');add(<?=$arResult["ID"]?>,<?=$arResult["PREVIEW_PICTURE"]["SRC"]?>)'>Добавить в корзину</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question