How to enable Yandex.Metrica?

In the widget event processing code, add the code for sending data to Yandex.Metrica. You will get something like this just after your widget code:
window.bukzaCallbackForBuzaContainer99999 = function(payload){
        //other handlers
        case 'ORDER_COMPLETED':
            ym(777777, 'reachGoal', 'booked',
                currency: "RUB"
In the example above:
  • uzaContainer99999 — the id value of the div container where the widget is inserted.
  • 777777 — the Yandex.Metrica tag ID.
  • booked — the Goal ID. The ID is set on the tag editing page when creating or changing a "JavaScript event" goal.
In this case, the initialization code of the Yandex.Metrica should already be added to the page with the widget. More information about sending data to the Yandex.Metrica read here.
If you insert code inside a widget, use something like this:
[Yandex.Metrica initialization code]
window.addEventListener('message', function (e) {
 if (e && e.origin
      && e.origin.indexOf('') !== -1)
   var message = JSON.parse(;
   switch (message.event) {
       //other handlers
       case 'ORDER_COMPLETED':
           ym(777777,'reachGoal', 'booked',
               currency: "USD"
   }, false);
Didn't find the answer to your question?
Feel free to ask it at