Why is there a Form Submit event on every page view?
Why is there a Form Submit event on every page view? Here’s a scenario. You enable a Preview and Debug mode in GTM, refresh the page and when the page loads, you see gtm.formSubmit or form submit event on the left side of the Preview console.
But the form on that page was not submitted! Or, maybe there is no form on that page at all!
Why is this happening? What is causing this?
This does not happen on all projects but some of us have definitely seen it. Right during the page loading process (before the appearance of the Window Loaded event), there is a gtm.formSubmit or form submit event.
Even if that page does not contain any form, we still see this event. And there are two prerequisites for this to appear:
- Facebook Pixel is implemented on a page
- At least one built-in GTM Form Submission trigger is enabled on a page.
If both of these “requirements” are met, we will see false gtm.formSubmit or form submit events. I call it false because they not related to actual forms that are a part of our website.
Why does this happen?
It’s just the way how Facebook Pixel sends now the data over to Facebook’s servers, via a form submission. As per the Simo Ahava’s comment in GTM Community on Facebook, Facebook uses a form submission for the pixel simply because it’s the most cross-browser-safe to send data to another domain. It basically creates a form with the data, then submits the form, and finally deletes the form.
So it doesn’t matter whether you have a form on a page, or you don’t. Facebook Pixel will do that anyway, as long as it is implemented on your page.
Form Submission trigger just displays those submissions in the Preview and Debug console because that’s its purpose, to display Form Submission Events.
You can distinguish a normal/usual form submission from the Facebook Pixel one by looking at the Data Layer.
Facebook Pixel’s form submission can be identified by two parameters:
- gtm.elementTarget (which can be used in GTM as a Form Target). Its value starts with fb and then is followed by some numbers.
- gtm.elementUrl (which can be used in GTM as a Form URL). Its value is https://www.facebook.com/tr/.
So what can you do about that false gtm.formSubmit or Form Submit event on every page view?
Honestly, not much. That’s just how the FB Pixel works now. You will continue seeing that event in your preview and debug mode as long as you have at least one Form Submission trigger enabled on a page.
But just to make sure that your trigger does not falsely fire a tag on such gtm.formSubmit, update your trigger’s conditions by adding the following line:
Form URL does not contain facebook.com/tr
Need help with Digital Analytics? Get in touch: