Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #891024

    Tried add this code to functions.php in ‘child theme’, but it breaks the site. Am I doing this wrong? Thought latest GA didn’t require the funny codes at the end there from the Enfold example: https://kriesi.at/documentation/enfold/add-onclick-event-to-the-contact-form-submit-button/

    If those “XXX/XXX” codes are required, how do I find / generate them in GA?

    Thanks!

    // ADD GA TRACKING TO EMAIL FORM
    
    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(['_trackEvent','Contact Form Send','Click/Touch','Footer']);"";
      return $att;
    }
    #891357

    Hey jomtones,

    You need to escape the next to last double quote too:

    
    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(['_trackEvent','Contact Form Send','Click/Touch','Footer']);\"";
      return $att;
    }
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #895100

    Thanks Victoria! Amazing how brittle programming still is in 2018.

    #895130

    Hi,

    You are welcome!

    Best regards,
    John Torvik

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