A
A
anton_trofimov952018-11-29 15:04:53
1C-Bitrix
anton_trofimov95, 2018-11-29 15:04:53

How to add Yandex metrics goals in Bitrix?

I found here on the toaster this code for adding goals

jQuery(document).ready(function() { 	
  jQuery( "#idForm" ).submit(function( event ) {		
    yaCounter1234567.reachGoal('Feedback');		
    console.log("target reached!");	
  });	
});

How to connect this code in Bitrix? Or how to set it up without it, tell me pliz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Filippenko, 2018-11-29
@anton_trofimov95

Deal with JS first.
This code, after the document is fully loaded, broadcasts to the form submission event with ID='idForm', sending information about the achievement of the metric goal. Customize it first.
Well, then include in any JS file on this page, or directly in the html in the script tag.
And the simplest thing is to find the template of this site and add it to footer.php (but there js will work in general on all pages, which is not good).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question