• Hi

    I currently use Additional Settings to set the Category for each form which allows me to track form submissions in Google Analytics (via GTM) …

    on_sent_ok: "dataLayer.push({'Category': 'Contact - General Enquiry'});"

    With on_sent_ok being depreciated I looked at using [contact-form-7 id="123" title="Contact Us Form" <strong>html_id="Contact - General Enquiry"</strong> <strong>html_name="Contact - General Enquiry"</strong>] however both html_id and html_name strip the spaces.

    Inspecting via browser shows <form name="Contact-GeneralEnquiry" ... id="Contact-GeneralEnquiry">, as you can see spaces in each are stripped.

    Is there a way to encode so the spaces are retained?

    I can survive if we can’t it’s just that it will create a mismatch in Google Analytics so I won’t be able to compare on_sent_ok events with post-on_sent_ok events.

    I understand that Targeting Individual Forms can be used via https://contactform7.com/2017/06/07/on-sent-ok-is-deprecated/ however I have many forms and am trying to be more dynamic in my approach.

    Thanks for your time.

  • The topic ‘Stripped Spaces in html_id & html_name’ is closed to new replies.