Do you have more than Forminator form on your WordPress site? Here's how to differentiate between them in GA4 using Google Tag Manager.
A while back, I wrote an article on tracking Forminator form submissions with Google Tag Manager (GTM). Since then, a couple of commenters on that article have asked about differentiating between multiple forms. This applies if you have two or more different Forminator forms on your site and you want to track which one received each submission (in Google Analytics 4, presumably).
This is certainly possible - but as the explanation was longer than my original article, I thought it warranted a brand new article of its own: this one.
In the previous article, we saw that a successful Forminator form submission results in an event called 'ajaxComplete'. As a reminder, here's what it looks like in Google Tag Manager's preview and debug mode:
Generally speaking, the easiest way to differentiate between forms would be to use some key like Form ID or Form Name which has a unique value for each form. Sadly there are no such keys in this ajaxComplete event, so we'll need a different approach.
While there isn't an Form ID or Name, there is a success message. This is the text that is displayed to the user as an inline message when they successfully submit a form (you may remember that we aren't directing our users to a separate success page). Here's what the success message looks like on this site, where it reads "Thank you for contacting me! I'll get back to you ASAP":
And if you didn't spot it earlier, here's that text in the example response:
By giving each form a unique success message, we'll be able to distinguish between them in Google Tag Manager (and then in GA4). First, here's how to customise each form's success message:
The next step is to make sure we are capturing the success message for each form submission as a data layer variable in Google Tag Manager:
Now you can include this text as an event parameter on your GA4 form submission event. (You may be using the event name form_submit, the same as GA4 enhanced measurement, or you may be using a custom event name - it doesn't matter. My event is called 'form_submission' for reasons that currently escape me.)
There isn't a default parameter name for the form response, so just call it something sensible like form_response_message - then select your new data layer variable as the parameter value. (Click on the 'brick' icon then select it form your list of variables.) You should end up with something like this:
Then save your changes to the event tag, and publish your Google Tag Manager container.
Next, we'll head over to GA4 to add our new parameter as a Custom Dimension. This will allow us to use it in Explorations (custom reports) and so on.
The most important field here is 'Event parameter', which must exactly match the parameter name you used in Google Tag Manager. Note that although this field is a dropdown, you can just paste in your value (as it may not appear as one of the options in the dropdown).
You will also want to give your dimension a sensible dimension name, as we will need to find it later on when we build an Exploration.
Notice as well that we've left the dimension as 'Event' scoped.
There are two different ways to test your new parameter in GA4: either by using the Real-time report, or by using DebugView.
The real-time report is slightly easier, as you don't have to make sure your device is sending debug events. Here's how:
If you would rather use DebugView, the simplest way is to send your form submission using Google Tag Manager's preview and debug mode. This will, by default, add a parameter to ensure your event appears in DebugView.
Now you are confident that your parameter is being captured correctly, you can include it in an Exploration.
And now your Exploration will show you the number of form submissions you have received per form (based on response message). Something like this:
Not seeing any data? You may just need to be patient. Remember that GA4 has quite high data processing times - as Google's Analytics Help says:
"Google Analytics allows for a data processing delay of 24-48 hours. During that time, data may change, so reports may not be consistent when viewing the last 24-48 hours in an account."
So this is a simple example, but you can see that we are now differentiating between our different forms in GA4.
There are lots of things we could do to enhance this - for example, using a lookup table in GTM to look up a form name based on the response message, and then passing that form name to GA4 instead of the entire message. But I hope this helps you get started.