Hi there, guys! I don’t know, is my question “out of scope” or not, but i will try…
I need to track click event on mailpoet subscribe button. It’s all about Google Analytics and Yandex Metrika…
I’m already done with Contact Form 7 and X Pro button:
Contact Form 7
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
yaCounter52890739.reachGoal('orderSpecialistCallFormSend');
ga('send', 'event', 'Отслеживание форм', 'Заказать звонок - форма');
}, false );
</script>
X Pro Button:
Add class to a button ga-event-call
Add JS to Theme Options
jQuery(document).ready(function($){
$('.ga-event-call').on('click', function(){
yaCounter52890739.reachGoal('orderSpecialistCallButtonClick');
ga('send', 'event', 'Отслеживание форм', 'Заказать звонок - кнопка');
});
});
Now it’s MailPoet time. Can you suggest, there should i start from?