Tracking Forminator form submissions with Google Tag Manager (GTM)

27 November 2020

This article builds on the work of Julius Fedorovicius at Analytics Mania to track Forminator's AJAX form submissions using Google Tag Manager.

Introducing Forminator

Forminator is a powerful freemium form builder plugin for WordPress with more than 100,000 active installations. It's also what I use here on So how do you track Forminator form submissions as events in Google Analytics (Universal Analytics) using Google Tag Manager?

Forminator's default behaviour is to use AJAX to send the form without reloading the page, and then display an inline message following successful form submission. As a result, the out-of-the-box 'Form Submission' trigger type in Google Tag Manager doesn't work with Forminator.

'Redirect user to a URL'

One option would be to change Forminator's settings and 'Redirect user to a URL' after a successful submission (this can be set under Forms > EDIT > Behaviour).

Forminator URL redirect

If you did this, you could then create a trigger in Google Tag Manager that fired on the 'success' page.

But what if you want to keep Forminator's default settings and still track form submissions? You're in luck - the brilliant Julius Fedorovicius at Analytics Mania has written a comprehensive guide to tracking AJAX form submissions using Google Tag Manager. This in turn makes use of an AJAX listener shared by Bounteous.

I would recommend following Julius' guide while making just a couple of small changes specific to Forminator - one to the Data Layer Variable Name, and one to the trigger.

Tweaking the Data Layer Variable Name

Here's what the data layer values for the ajaxComplete event look like in the Google Tag Manager preview and debug console following a successful Forminator form submission:

ajaxComplete in data layer

When I first wrote this post, I suggested using the Data Layer Variable Name attributes.response.success. However it occurred to me the following day that both this key and the value (true) were rather generic.

This raised the possibility that something that uses AJAX other than Forminator might add exactly the same key-value to the data layer. And if that were to happen, it could trigger false positive form completions.

Perhaps I am being overly cautious, but I have changed my own setup to use the following Data Layer Variable Name:

Datalayer variable

This has a value of behaviour-thankyou on a successful form submission. Note the British English spelling of 'behaviour'! And if you Google this phrase (with quotes), the only relevant results relate to Forminator so I am fairly confident that we will be able to avoid any false positives.

Tweaking the trigger

Your trigger in Google Tag Manager will also need to be changed to take into account the value you are capturing. My trigger looks like this:

Forminator form submission trigger

I hope this is of some use - and if you still need help tracking your Forminator form submissions in Google Tag Manager then do get in touch.

Notify of
1 Comment
Inline Feedbacks
View all comments
1 year ago

Thanks for this. I had initially tried Julius Fedorovicius at Analytics Mania's way and it hadn't worked and now your small tweak to the dataLayer variable actually made my Tag fire. I appreciate it

Last edited 1 year ago by anonymous
James Clark
Hi! I'm James Clark and this is my website. I publish all my guides completely free, so if you find them useful then please:
What do you think? Leave a commentx
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram