Tagged: CONTACT FORM, submit button, Tracking Code
I want to track when a user enters details then clicks the ‘Submit’ button from AdWords. I have been given the code I need to add but I don’t know where to add it.
I need to change this:
<input type=”submit” value=”Submit” class=”button” data-sending-label=”Sending”>
to this:
<input type=”submit” value=”Submit” class=”button” data-sending-label=”Sending”>onClick=”ga(‘send’,’event’,’Request A Quote’,’Submit Button’,’/underfloor-heating-system-quote’);”
Thank you
Hey pachanights!
Please refer to this post – http://kriesi.at/documentation/enfold/add-onclick-event-to-the-contact-form-submit-button/
Best regards,
Yigit
Thanks Yigit, I’ve read that post already and still not clear where the file is to add the code to
Hi!
Insert this code into the child theme functions.php file and the rest will be done.
Thanks a lot
Best regards,
Basilis
Hi!
Please try adding the code to functions.php file in Appearance > Editor
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=\"ga('send','event','Request A Quote','Submit Button','/underfloor-heating-system-quote');\"";
return $att;
}
Cheers!
Yigit