Answer the question
In order to leave comments, you need to log in
How to add a Yandex metrics and analytics goal to a button in a form in 1c bitrix?
Hello. You need to set goals for the buttons "Add to cart" and "send request" (in a pop-up form) on the page with the goods of the online store.
I can't figure out where to put an event for metrics and analytics, like
onsubmit="ga('send', 'event', 'form', 'check'); yaCounterХХХХХХХХ.reachGoal('form'); return true;"
Where is the template for the "add to cart" and "send request" buttons.
I found the template for the form Services-> Web Forms-> Form Settings
inserted an event here, but Google Tag Assistance did not show the execution!
Please explain to NUBU what and how to do?
Answer the question
In order to leave comments, you need to log in
The first part of the goal, metrics, the second Google
Insert into
<form ... onsubmit="">
<div>
<label>Название</label>
<input ...>
</div>
</form>
Where is the template for the "add to cart" and "send request" buttons.
I recommend downloading the entire folder with the site template via FTP and searching for the text "add to cart" to look for the file in which this button and add the necessary code there. The site template is located here: /public_html/bitrix/templates/folder_with_template/
To search by the contents of files, you can use the Total Commander file manager.
or you can just add a target to the button with a js script:
$('.product .add-to-basket').attr('onclick','yaCounterXXXX.reachGoal("goal_id")');
.product .add-to-basket button selector
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question