Tagged: tag manager
-
AuthorPosts
-
April 22, 2020 at 12:39 pm #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: buttonBut 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/April 26, 2020 at 11:45 am #1207217Hey 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-429580You 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,
VictoriaApril 27, 2020 at 4:25 pm #1207539Dear 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 :)May 3, 2020 at 6:29 pm #1209322 -
AuthorPosts
- You must be logged in to reply to this topic.