It is necessary to add an id to the button so that the metric tracks clicks. There is a button code

<div> <? if ($arResult['PRICES'][$sPriceCode]['CAN_BUY'] == 'Y' && $arResult['CATALOG_AVAILABLE'] == 'Y'): ?> <form method="POST" style="margin-right:300px" class="basket-form" data-ajax="<?= $APPLICATION->GetCurPageParam(); ?>> <input type="hidden" name="action" value="ADD2BASKET"> <input type="hidden" name="id" value="<?= $arResult['ID']; ?>"> <input type="number" min="1" max="999" value="1" class="quantity" name="quantity"> <input type="submit" value="<?= $arParams['MESS_BTN_ADD_TO_BASKET']; ?>" class="button"> <input type="hidden" name="basket_url" value="<?= $arParams['BASKET_URL'] ?>"> <input type="hidden" name="price_code" value="<?= $sPriceCode ?>"> </form> <? endif; ?> </div> 

The code for handling the event is "onclick="yaCounter35993580.reachGoal('ORDER'); return true;" "onclick="yaCounter35993580.reachGoal('ORDER'); return true;" Did so <form method="POST" style="margin-right:300px" class="basket-form" data-ajax="<?= $APPLICATION->GetCurPageParam(); ?>"onclick="yaCounter35993580.reachGoal('ORDER');"> <form method="POST" style="margin-right:300px" class="basket-form" data-ajax="<?= $APPLICATION->GetCurPageParam(); ?>"onclick="yaCounter35993580.reachGoal('ORDER');"> But not under any conditions, the metric does not see the press, return true when I add, too, nothing changes. Where does it really need to be put in to make it work?

  • Are you sure you created and correctly set a goal on the goals page? metrika.yandex.ru/[YOUR_ID[? tab = goals - blits
  • Naturally, the goal is there, the goal identifier is ORDER, everything is as it should be - Evgen

0