Tagged: google tag manager
Hi
How do I ad GTM capability to a contact form to track when the form is submiited.
The form is on https://fairfieldnutrition.com.au/what-we-treat/ibs/
Many thanks
Steve
Hey StephenWard9,
I think this article will help you to add a tracking event: https://kriesi.at/documentation/enfold/contact-form/#add-on-click-event-to-the-contact-form-submit-button-
So basically add this code to your child theme functions.php:
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 = "onclick=\"_gaq.push(['_trackPageview', '/VP/XXX/XXX']);\"";
return $att;
}
and replace:
_gaq.push(['_trackPageview', '/VP/XXX/XXX']);
with your tracking event.
Best regards,
Peter