Forms & Popups

How to set up Google Tag Manager event Tracking for Greyd.Forms

This article explains, how you can track form events from your Greyd.Forms forms in Google Analytics using the Google Tag Manager.

Step 1: Create variables

The variables ensure that a Greyd form is recognized on a page and that the form CSS ID, form post ID and form name are read out. The form CSS ID is used to recognize the correct form in the DOM, the other two to pass on the form recognition data to Google Analytics.

  • This is done using the CSS selectors:
  • “form.greyd_form” → id (form CSS ID)
  • “form.greyd_form” → data-id (form post ID)
  • “form.greyd_form” → data-title (form name)

Go to "Variables" and create 3 new variables:

Screenshot of GTM variables configuration

Screenshot of GTM variables configuration

Screenshot of GTM variables configuration

Step 2: Configure triggers

Go to "Triggers" and configure at least the first one:

  • GA4 Form Trigger

    The first trigger ensures that the GA4 Form Submission tag is called when the event with the name “greydFormSubmission” is recognized.

Screenshot of GTM trigger configuration

  • Exclude WordPress Backend

    The second trigger is optional. It ensures that a page view is always prevented from being tracked in the WordPress backend. Depending on how the Tag Manager script was integrated, this can be important.

Screenshot of GTM trigger configuration

Step 3: Configure Tags

Go to "Tags" and configure the following tags:

  • GreydFormSubmission Script

This tag plays a script that checks whether a form is submitted. After the form has been submitted, the “greydFormSubmission” event is triggered and the “GA4 Form Trigger” is activated. This also writes the data layer variables on the form page.

Screenshot of GTM tag configuration

<script> jQuery(document).ready( function() { jQuery(document).on('submit', function(event) { dataLayer.push ({ 'event' : 'greydFormSubmission', 'GreydformID' : {{Greyd Form ID}}, 'GreydformName' : {{Greyd Form Name}} }); }); }); </script>

  • GA4 Form Submission

This tag contains the measurement ID of the Google Analytics account and defines the data that is transferred to the Google Analytics account. It is triggered by the “GA4 Form Trigger” trigger.

Screenshot of GTM tag configuration

  • If you have already created your GA4 property in Google Analytics and generated a data stream, you can copy the measurement ID for the GA4 configuration tag here.

Screenshot of GTM data streems dashboard

Step 4: Check data in Google Analytics

Once you have set this up, you can now call up a form for testing, fill and submit it. It may take a few seconds for the data to appear in the real-time report. If a caching plugin is installed on the page, we recommend to delete the cache first.

Screenshot of GTM real time report with a successful form tracking

After 24 hours you will also find the data in the Engagement report:

Screenshot of GTM engagement report with a successful form tracking

Please note: For the form tracking in Google Tag Manager to work, there cannot be more than one form on a page.

This is a container export of the GTM settings.

You can upload it to your Google Tag Manager and replace the anonymous mess-ID with yours. Please note: Use the merge mode if you already have a configuration in your account that you want to keep. Otherwise the upload will overwrite it.

Related articles & tutorials

How to set up Google Tag Manager event Tracking for Greyd.Forms

This article explains, how you can track form events from your Greyd.Forms forms in Google Analytics using the Google Tag Manager. Step 1: Create variables The variables ensure that a Greyd form is recognized on a page and that the form CSS ID, form post ID and form name are read out. The form CSS […]


Forms & Popups

How to create custom actions in globally connected forms

Greyd.Suite enables you to synchronize posts across several websites with Global Content. However, you can customize specific meta fields — like a forms admin mail_to field — locally for individual posts without disrupting global synchronization.How it works With a simple code snippet added to your child theme's functions.php you can:enable local editing of any meta […]


Forms & Popups, General Questions, Website management

Where do I find the form ID?

To use the form ID for example in the Conditional Content Block, simply open the corresponding form. You will now find the form ID at the top in the URL, e.g. "post=17967"


Forms & Popups

Is it possible to have conditional follow-up actions in forms?

Imagine a contact form on a corporate website that triggers an admin notification to different departments (e.g. HR, marketing, sales) depending on the user's entries? Or a lead form with different product categories that automatically notifies the responsible sales employee? This is actually possible with Greyd.Forms. Here's how: As an example we are going to […]


Forms & Popups

What do I do when there is an error message in the forms backend?

GREYD.Forms informs you in various ways should anything go wrong with a form – e.g. if an interface is not working as it is supposed to or if an email could not be sent. You will see the respective error message in the form entry and – depending from your settings – also as an […]


Forms & Popups

How can I reset forms statistics?

While there is not yet a native option to reset forms statistics, it is still very easy to reset them manually with GREYD.Hub:Open the database tab and search for the tables of the respective website. You should find a table calledwp_greyd_forms_interactions or similar.Select it, scroll down and click on "delete table". Your form stats should then […]


Forms & Popups

How do I create a form that only allows a certain number of submissions?

With the following code snippet you can easily use GREYD.Forms to create a form that only allows a limited number of form submissions and displays a corresponding info message. Please be aware of the comments in the snippet as the code needs to be adapted individually.if ( ! defined( 'COUNTER_FORM_ID' ) ) { /** * […]


Forms & Popups

An error message appears when submitting a form in the frontend.

If an error message appears on the frontend when filling out a form, you may receive an admin notification that the validation of a WordPress NONCE failed.NONCE is a WordPress security token that is also integrated into GREYD.Forms. NONCEs are used to protect against abuse and malware. If you receive such a notification, it means […]


Forms & Popups

Forms & Popups

How to create quiz & live surveys

In this video, we are going to show you how to create interactive gamification elements in Greyd.Forms and add for example a quizz or survey with live feedback to your forms.

Forms & Popups

How do I use input fields?

Input fields are used wherever you want the user to enter something. In this video, we will show you how to set up fields for name, address or other inputs and which settings you can make.

Forms & Popups

What are the basic settings in Greyd.Forms?

Learn how to deposit a general privacy text for your forms and how to protect them against bots & malware. The video also shows you how to prevent your form mails from ending up in the spam folder and how to connect Greyd.Forms with your tools.

Forms & Popups

How can I make fields dependent from each other?

The conditional container block allows you to create dependencies between fields. Define, which fields should open after the user has chosen option A or B. Decide, if certain questions should be skipped depending on the user's entries.Learn here, how easy it is to create dependencies in Greyd.Forms.

Forms & Popups

How do I use image panels?

Image panels are a very good way to make your form more stylish. Instead of simple selection fields, show your user clickable image panels. This tutorial shows you the abundant, yet simple settings of the image panel block.

Forms & Popups

How do I use dropdown fields?

Allow your user to select from a dropdown list with the dropdown block. This video shows you which settings you can make.

Forms & Popups

How do I use radio buttons?

Similar to checkboxes, radio buttons are used to make a user select one of several options. Learn here how to use radio buttons.

Forms & Popups

How do I create a multistep form?

Especially for longer forms it may be useful to build your form with several steps. With next/back buttons users can navigate between the levels of your forms. Learn here how to easily create a multistep form with Greyd.Forms.

Forms & Popups

How do I create a contact form?

In this video, we are going to show you which widgets you can use to create a simple contact form. You will also learn how to set up e-mail notifications and integrate double opt-in for GDPR-compliant forms.

Forms & Popups

Which data can I find on form entries in the backend?

The Greyd.Forms backend shows you all form entries including status. You will also find detailed statistics to analyze your forms without an analytics tool and, of course, GDPR-compliant. This video also shows you how to delete form entries automatically.

Forms & Popups

How do I design checkboxes?

A checkbox can be used to accept terms & conditions or privacy regulations, but also to select options. Our checkbox tutorial shows you everything you need to know about Greyd.Forms’ checkbox block.

Forms & Popups

How do I use upload fields?

You want your user to upload a file to your form? No problem! Learn here which options Greyd.Forms offers to easily integrate an upload field.