Hello,
I want to track with Tag Manager the forms sent from my website:
But the form_submit event didn’t fire, only the form_start. I’ve got 2 forms: on homepage and on Contact page
Do I need to add something?
Thanks, regards
Karim Chouaib
Empatica Internet
Hi Empatica,
Please check Ismael’s answer on https://kriesi.at/support/topic/contact-form-submit-button-hook/ then you can combine it with is_page: https://developer.wordpress.org/reference/functions/is_page/ to check whether the page is coming from homepage or contact page.
Hope it helps.
Best regards,
Nikko
Hi Nikko,
Thanks for your answer. My problem is to capture an event when the form is sent, the page containing the form is not important. I’ve seen on Google that usually when you send a form, the browser fires an event: “form_submit” so you can track it with Tag Manager.
Do you know how to do it with Enfold forms?
Thanks,
Regards,
Karim
Hi,
The solution that Ismael posted fires on the avf_form_send filter, so it is the event when the form is sent, you can add your tag manager event code to it.
add_filter('avf_form_send', function( $proceed, $new_post, $params, $class ) {
// do something here
return $proceed;
}, 10 , 4);
Best regards,
Mike