Subscribe to our social networks

arrow icon All Post

How to Track Form Submits on GA4

Feb 23, 2024 | Author: Info Publytics

How to Track Form Submits on GA4

Here's a guide on how to track form submits on Google Analytics 4

Forms are an essential part of any website, as they allow users to interact with the site and provide valuable information or feedback. Whether it is a contact form, a sign-up form, a survey, or a checkout form, tracking form submissions can help you measure the performance of your website and optimize your conversion rate.

However, tracking form submissions is not always straightforward, as different forms may have different behaviors and technologies. For example, some forms may reload the page after submission, while others may use AJAX to send data without refreshing the page. Some forms may redirect the user to a thank you page, while others may display a confirmation message on the same page.

Fortunately, there are several ways to track form submissions using web analytics tools, such as Google Analytics. In this article, we will explore four of the most common methods and explain how to implement them on your website.

Method 1: Using Google Analytics Events

Another way to track form submissions is to use Google Analytics events. Events are user interactions with your website that are not captured by the default pageview tracking, such as clicks, downloads, video plays, etc. You can use events to track form submissions by sending an event to Google Analytics whenever a user submits a form on your site.

To use Google Analytics events to track form submissions, you need to create a custom event code and add it to your website. The event code should include four parameters: category, action, label, and value. The category and action parameters are required, while the label and value parameters are optional. You can use these parameters to describe the form and the submission, such as:

  • Category: Form
  • Action: Submit
  • Label: Contact Us
  • Value: 1

The event code should be triggered when the user submits the form, either by using a JavaScript function or by using a tool like Google Tag Manager. Google Tag Manager is a free tool that allows you to manage and deploy various tags (such as Google Analytics event codes) to your website, without modifying the source code. You can use Google Tag Manager to create a trigger that fires the event code when the user clicks on the submit button of the form, or when the form is successfully submitted.

Once you have added the event code to your website, you can view and analyze the form submission events in Google Analytics, under the Behavior > Events report. You can also create goals based on the events, to measure your conversion rate and track the value of the form submissions.

Method 2: Using Google Analytics 4 Automatic Form Tracking

If you are using Google Analytics 4 (GA4), the latest version of Google Analytics, you can take advantage of the automatic form tracking feature. This feature is part of the enhanced measurement option, which allows you to track common user interactions on your website, such as scrolls, outbound clicks, video plays, etc., without requiring any additional code or configuration.

The automatic form tracking feature can track two types of events related to forms: form_start and form_submit. The form_start event is triggered when the user interacts with any element of the form, such as entering text, selecting an option, or checking a box. The form_submit event is triggered when the user submits the form, either by clicking on the submit button or by pressing the enter key.

The automatic form tracking feature can also collect various parameters for each event, such as:

  • form_classes: The CSS classes of the form element
  • form_id: The ID of the form element
  • form_name: The name of the form element
  • form_fields: The number of fields in the form
  • form_field_name: The name of the field that the user interacted with
  • form_field_value: The value of the field that the user entered or selected
  • form_field_type: The type of the field, such as text, checkbox, radio, etc.

The automatic form tracking feature is enabled by default for new data streams in GA4, but you can also enable it for existing data streams, by navigating to the Data Stream settings and turning on the Form interactions option under the Enhanced Measurement section.

Once you have enabled the automatic form tracking feature, you can view and analyze the form events and parameters in GA4, under the Engagement > Events report. You can also create conversions based on the events, to measure your conversion rate and track the value of the form submissions.

Method 3: Using Google Analytics 4 Custom Events

If you want more control and flexibility over how you track form submissions in GA4, you can also use custom events. Custom events are events that you define and send to GA4, using either the gtag.js library or the Google Tag Manager interface. You can use custom events to track form submissions by sending a custom event to GA4 whenever a user submits a form on your site.

To use custom events to track form submissions, you need to create a custom event code and add it to your website. The custom event code should include two parameters: name and parameters. The name parameter is required, and it should be a unique and descriptive name for the event, such as form_submit. The parameters parameter is optional, and it should be an object that contains additional information about the event, such as:

  • form_id: The ID of the form element
  • form_name: The name of the form element
  • form_fields: The number of fields in the form
  • form_data: An object that contains the name and value of each field in the form

The custom event code should be triggered when the user submits the form, either by using a JavaScript function or by using Google Tag Manager. Google Tag Manager can help you create and manage custom events for GA4, by using the Google Analytics 4 Configuration tag and the Google Analytics 4 Event tag. You can use the Google Analytics 4 Configuration tag to set up the connection between your website and GA4, and the Google Analytics 4 Event tag to send the custom event data to GA4. You can also use Google Tag Manager to create a trigger that fires the custom event tag when the user submits the form, or when the form is successfully submitted.

Once you have added the custom event code to your website, you can view and analyze the form submission custom events and parameters in GA4, under the Engagement > Events report. You can also create conversions based on the custom events, to measure your conversion rate and track the value of the form submissions.


Posted: 1 month ago
Author: Info Publytics

Recent Posts

bg img

    Are you looking for a complete tool to measure your website's progresses? Get deep into Publytics with our 14 Days of free trial!

  • Try it for free