Answer the question
In order to leave comments, you need to log in
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")."\">";
<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>
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question