A
A
Ambal892017-04-20 16:07:54
PHP
Ambal89, 2017-04-20 16:07:54

How to set goals for a button in bitrix?

Hello comrades! Can you please tell me how to add targets to the buttons correctly? The site is on Bitrix, but it doesn’t matter, it’s more important to know javascript (which I don’t have yet). I rummaged through the site template for Bitrix, found a form file where all the variables are described, tried to set the goal there, but then all the buttons become with the same goals (it is logical).
the line looks like this (you never know, suddenly you need):

$arResult["SUBMIT_BUTTON"] = "<button class=\"".$arParams["SEND_BUTTON_CLASS"]."\" type=\"submit\">".$arParams["SEND_BUTTON_NAME"]."</button><br/><input type=\"hidden\" name=\"form_submit\" value=\"".GetMessage("FORM_ADD")."\">";

It became clear that you need to set goals earlier, on the way to this file. I found a feedback template file, like what you need, the code is:
<div class="form-footer clearfix">
        <div class="pull-left required-fileds left">
          <i class="star">*</i><?=GetMessage("FORM_REQUIRED_FILEDS")?>
        </div>
        <div class="pull-right left">
          <?=$arResult["SUBMIT_BUTTON"]?>
        </div>
      </div>

Can you please tell me how to add an onclick parameter to a button using javascript?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Grabko, 2017-04-20
@Dima_So

Add to the .js file connected to the site
$('. {form class, buttons, links} ').click(function(){
yaCounter {counter number} .reachGoal(' {Goal ID} ');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question