My idea is:
Who would benefit from this idea?
Any Mautic users, concerned about measuring Mautic’s form submissions with a third party app (i.e. Google Tag Manager + Google Analytics)
Why I think they would benefit from this idea:
Currently, every time the internal name of a form is being modified, the value of the id attribute is re-written. It’s a big issue, because the idea should be stable.
When we track form submission with auto-events “Form Submits” with a tool such as Google Tag Manager, it makes perfect sense, for maintainability reasons to identify a form by its location (i.e hostname, page path) and form ID. To be reliable, the ID must not change in unpredictable ways, ot the trigger will always need to be adjusted and we become obsolete with no alert.
Assets in Mautic already implement something slightly similar to what I propose here : The slug of an asset is generated for the first time from the name when an asset is created but then, it won’t be modified after further asset renaming. However it can be updated independantly.
Forms should offer the same mechanism. If Mautic users wants to modify the form ID’s attribute value, they should be able to do it intentionally through an input field dedicated for it in the form edit view in Mautic.
Habing this feature would make Mautic form safer to rename (and therefore organize : it’s important to able to rename marketing automation components to improve readability, especially when many components/forms co-exists) while not breaking any tracking/measurement mechanism already implemented on the website.
Any code or resources to support this idea:
To support this idea, I propose the following arrangements :
- Add a new tab called “Advanced” in the Mautic form edit view,
- Add a “Form ID” input field (probably need a new database field if the present ID was always calculated from the form name)
- Remove the logic that binds together the form’s name updates and the form ID