Mautic is a very flexible and powerful Marketing Automation tool. When you create forms in Mautic for online campaigns, it's important to track conversions from Google Analytics in order to optimize your media placement spend.
In order to track Mautic from form submissions found in Google Analytics, you need to use Google Tag Manager. A powerful tag manager can allow you to configure tags, triggers and variables. When used with JavaScript and (or) RegEx effectively, the possibilities become endless. It is the latter that will serve as the subject of this tutorial. RegEx is extremely useful for extracting information from any text by searching for one or more matches of a specific search pattern, even an HTML page.
First, you need to build a Mautic form. Once the form is created, you must integrate it into your website with the automatic option found in JavaScript. The form will automatically generate on your page.
To understand what we are going to look for in the form, use the Google Chrome Inspector. Hover over the form area, right-click and select Inspect. In the example above, we find on line 1 the element of the form. We need to find his ID, mauticform_newsletteren
. Since all Mautic form ID’s begin with mauticform_
, we will use RegEx to retrieve all form ID’s. Line 2 is the confirmation message, empty in the example. When the form is submitted and confirmed, the confirmation message appears in this item. We will use the class mauticform-message
to detect the element when a message is displayed.
The difficulty with Mautic forms is that the HTML tag that confirms the submission of the form is still present on the page. However, this item is empty and prints the message only when it has message confirmation. For this purpose, we will use the variable DOM Element. This is a variable in Google Tag Manager that allows you to "scratch" the content directly from the Document Object Model (DOM). In other words: with this help of this function, you can transfer any text on your website into a variable and pass it on to Google Analytics.
div.mauticform-message
This variable will help the trigger to detect the submission confirmation of the form.
.*
mauticform_.*
The trigger will find all forms whose ID starts with mauticform_
, or all Mautic forms and it will launch the tag when a message is displayed, or the confirmation of submission of the form.
At this point, Google Analytics already tracks the events related to the programmed submission extracted from the Mautic form, but they are not registered as a conversion goal. You can view events in Google Analytics under Behavior> Events. The final step is to set up a conversion goal.
In our example, we use RegEx again, because we want to track two different language forms for the same purpose. We have therefore inserted our form ID accordingly: mauticform_newsletter.*
The field value can be left empty, or you can use it if there is a monetary value.
Remember to test your form and visit Google Analytics to see if your conversion has been saved. Confirmation of forms is very important for optimizing campaigns and for monitoring marketing actions in general. It allows you, among other things, to calculate the conversion rate of the different channels you use. To fully understand the power of metrics related to Google Analytics, I invite you to sign up for one of the digital marketing courses offered by Parkour3. Contact an Expert
French-English Translation Services Provided By Robert Fabris