Answer the question
In order to leave comments, you need to log in
Baforms+Joomla can't insert code for Yandex metrica goal?
There is a callback form on Baforms+joomla at the bottom On a blue background.
Can't insert event on submit button.
I try both onclick and onsubmit.
I insert the code into the button through the AC, setting up the forms, the form, the Embed Code of the send button.
Tell me what am I doing wrong? The counter is not updated in YaMetrika.
Answer the question
In order to leave comments, you need to log in
jQuery( document ).ready( function() {
jQuery( document )
.on('click', '#id', function() {
ym(55311013, 'reachGoal', 'name_goal');
return true;
});
});
Line 3: you can change click to submit so that the script reacts to submitting the form, and not to clicking. The main thing in #id is to specify the id of the form, not the button.
3rd line: replace #id with your own and don't forget about the special # symbol. Instead of #id, you can specify the selector through a dot, for example, .class-name.
Line 5: 55311013 change to your counter number. Counter number, not target number!
Line 5: name_goal is the name of the goal identifier, change it to your own, which you wrote in the Yandex Metrica goal settings.
And don't forget to wrap the entire script in .
Source: https://blog.vverh.digital/2019/install-reach-goal...
At the click of a button, the data was successfully transferred to the metric, but so far, alas, I have not found a solution for submitting the form...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question