How to set some goals for the PITS on several CF7 forms?

Wrote such code:

< script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '123' == event.detail.contactFormId ) {
ga('send', 'event', 'order2400', 'Submit');
yaCounter££££££.reachGoal('order2400');
}
if ( '456' == event.detail.contactFormId ) {
ga('send', 'event', 'order2800', 'Submit');
yaCounter££££££.reachGoal('order2800');
}
if ( '789' == event.detail.contactFormId ) {
ga('send', 'event', 'order_end', 'Submit');
yaCounter££££££.reachGoal('order_end');
}
}, false );
script>

Doesn't work, tell me what's the error?
June 8th 19 at 17:16
1 answer
June 8th 19 at 17:18
strange, but the goal fell in about 20 minutes. wpcf7:mailsent I didn't know before that the purpose was one, worked fine, with this code:
< script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
yaCounterXXXXXXXX.reachGoal('ORDER');
}, false );
< /script> - Kelton.Bode commented on June 8th 19 at 17:21

Find more questions by tags Yandex.MetricaWordPress