H
H
hdiyls72017-08-21 00:15:08
HTML
hdiyls7, 2017-08-21 00:15:08

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 6501c524116642518f8603f9b992d1de.jpg
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

2 answer(s)
L
Localhost, 2017-08-21
@selo

The first part of the goal, metrics, the second Google
Insert into

<form ... onsubmit="">
<div>
<label>Название</label>
<input ...>
</div>

</form>

O
Oleg, 2017-09-24
@nugget-ekb

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 question

Ask a Question

731 491 924 answers to any question