Tagged: CONTACT FORM, enfold, google tag manager, GTM
Hi everyone,
I need your help and I’m a bit lost. I’m trying to track form submissions from the Enfold contact form using Google Tag Manager.
I’ve already added the following code to the functions.php file, as recommended in this thread: https://kriesi.at/support/topic/contact-form-tracking-with-gtm/
add_filter(‘avf_contact_form_submit_button_attr’,’avia_add_submit_attributes_to_cf’, 10, 3);
function avia_add_submit_attributes_to_cf($att, $formID, $form_params){
$att = “onsubmit =\” dataLayer.push({‘event’: ‘form-submission’}); \””;
return $att;
}
Everything in GTM seems to be set up correctly, but for some reason, the event isn’t firing. Does anyone have an idea what I might be missing?
Best regards,
Chris
Hey christianh150,
Thank you for the inquiry.
Did you create a custom GTM event for the form-submission? Please check this article and watch the video for more info.
— https://support.google.com/analytics/answer/12229021?sjid=3714059059832338320-NC
— https://www.youtube.com/watch?v=QmEOPuJr05w
Let us know if you need more info.
Best regards,
Ismael
Hi,
yes. I have created a Form-Submission GA4 Event in GTM.
B.r.
Chrirs
Hello,
I looked at the documentation and the video again. I implemented everything exactly as described.
Other tags are fired. It’s really only about the GA4 event form submission with the Enfold contact form. That is not fired.
Best regards,
Chris