Tagged: 

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

    Although I found several threads on this I’m still not sure how to correctly track succesfully submitted contact forms with Tag Manager.

    I managed to identify the following for my Tag Manager settings:

    Class element: [object HTMLInputElement]
    Form Classes: button

    But now I’m measuring all clicks on the button of the form, not just the succesfully send forms, I can’t find any identificator for this in the GTM debugger.
    I’m quite new to this, so perhaps you could provide me with a step by step progress of this?

    I found this thread and added the code to the function.php file, but I’m really not sure how this can help me with my problem?
    https://kriesi.at/support/topic/tracking-contact-form-in-google-tag-manager/

    #1207217

    Hey NewbieEnfold,

    The code shared here adds an attribute to the submit button of the contact form. So it will track the contact form submissions.
    https://kriesi.at/support/topic/tracking-contact-form-in-google-tag-manager/#post-429580

    You can try adding the code for the submit event instead:

    
    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 = "onsubmit =\" dataLayer.push({'event': 'form-submission'}); \"";
        return $att;
    }
    

    Best regards,
    Victoria

    #1207539

    Dear Victoria, thx, where would I need to add this?
    With the code you propopse, I could track the even ‘form-submission’ in GTM?
    I’m stuck with this with two sites (and counting) that I build with Enfold, so would be great to get as much insight/details as possible :)

    #1209322

    Hi,
    Sorry for the late reply, the code above should be added to the end of your functions.php file in Appearance > Editor
    You should then start seeing the event “form-submission” in your GTM, I think there is a 24-hour delay for reporting events.

    Best regards,
    Mike

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