Hey everybody,
when submitting the contact form I would like to push the following code to the google tag manager:
on_sent_ok: "dataLayer.push({'event': 'contactform-submitted'});"
In other wordpress designs I found some contact-form options where you are able to insert advanced settings – are similar options available for enfold too?
Thank you!
Hi jhop75!
Try adding this to the bottom of your /enfold/functions.php file.
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=\" dataLayer.push({'event': 'contactform-submitted'}); \"";
return $att;
}
Cheers!
Elliott