Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #352391

    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!

    #352567

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.