{"id":383,"date":"2021-03-09T14:41:17","date_gmt":"2021-03-09T14:41:17","guid":{"rendered":"https:\/\/organicdigital.co\/blog\/?p=383"},"modified":"2026-09-23T03:43:46","modified_gmt":"2026-09-23T02:43:46","slug":"how-to-track-form-field-values-in-ga4-using-google-tag-manager","status":"publish","type":"post","link":"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/","title":{"rendered":"How To:  Track Form Field Values in GA4 Using Google Tag Manager"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>TL;DR:<\/strong> <br>Google Tag Manager can capture selected non-personal form field values and send them to GA4 as event parameters alongside a successful form submission. This can help you analyse things like enquiry type, product selection or stages within a multi-step form rather than simply counting submissions. The important part is to only collect useful, predefined values and avoid sending personal information or uncontrolled free-text data to Google Analytics.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Why_track_form_field_values_as_well_as_submissions\" >Why track form field values as well as submissions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#What_form_field_values_can_you_track_in_GA4\" >What form field values can you track in GA4?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Privacy_considerations_when_tracking_form_field_values\" >Privacy considerations when tracking form field values<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#How_to_capture_form_field_values_with_Google_Tag_Manager\" >How to capture form field values with Google Tag Manager<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Step_1_%E2%80%93_Find_the_form_field_values_in_GTM\" >Step 1 &#8211; Find the form field values in GTM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Step_2_%E2%80%93_Create_variables_for_the_form_field_values\" >Step 2 &#8211; Create variables for the form field values<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Step_3_%E2%80%93_Detect_the_successful_form_submission\" >Step 3 &#8211; Detect the successful form submission<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Step_4_%E2%80%93_Send_the_form_field_values_to_GA4\" >Step 4 &#8211; Send the form field values to GA4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Step_5_%E2%80%93_Test_the_form_field_tracking\" >Step 5 &#8211; Test the form field tracking<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#How_to_analyse_form_field_values_in_GA4\" >How to analyse form field values in GA4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Taking_form_submission_tracking_a_step_further\" >Taking form submission tracking a step further<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/daveashworth.co\/blog\/how-to-track-form-field-values-in-ga4-using-google-tag-manager\/#Should_you_track_form_field_values_in_GA4\" >Should you track form field values in GA4?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_track_form_field_values_as_well_as_submissions\"><\/span>Why track form field values as well as submissions?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tracking a form submission tells you that somebody completed a form. Sometimes, though, you want to understand a little more about <strong>what was submitted<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a form might contain a dropdown for an enquiry type, product category or application option. Capturing that non-personal value alongside the submission event can provide much more useful information in GA4 than simply counting the number of completed forms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I originally implemented this using <a href=\"https:\/\/daveashworth.co\/skills\/google-tag-manager-consultant\/\">Google Tag Manager<\/a> for a client with a multi-step application process. I then recreated a simplified version on my own website to demonstrate how GTM could capture selected form field values and send them to Google Analytics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The original implementation used Universal Analytics, so some of the Analytics screenshots in this article are inevitably dated. I haven&#8217;t recreated the old forms purely to produce new screenshots. <strong>The underlying GTM approach remains useful, but today I would send the captured values to GA4 as event parameters.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is taking <a href=\"https:\/\/daveashworth.co\/blog\/how-to-configure-events-and-conversions-for-google-analytics-4\/\">form submission and conversion tracking<\/a> a step further. Instead of only asking <em>&#8220;was the form submitted?&#8221;<\/em>, we&#8217;re asking <em>&#8220;what non-personal information can we safely capture about that submission?&#8221;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_form_field_values_can_you_track_in_GA4\"><\/span>What form field values can you track in GA4?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before getting into the implementation, there&#8217;s an important distinction between <strong>tracking a form submission<\/strong> and <strong>tracking values from the fields within that form<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A standard form tracking setup might send an event to GA4 whenever somebody successfully submits a contact or enquiry form. That&#8217;s useful for measuring conversions, but it doesn&#8217;t necessarily tell you anything about the type of enquiry or options the visitor selected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the project that originally prompted this article, the client had an application process split across several steps. Their own database already stored the submitted information, but they wanted additional analytics data to understand how users progressed through the process and how different non-personal selections were distributed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s where capturing form field values with GTM became useful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suitable values might include things such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>enquiry or application type<br><\/li>\n\n\n\n<li>product or service category<br><\/li>\n\n\n\n<li>selected plan or option<br><\/li>\n\n\n\n<li>a yes\/no selection<br><\/li>\n\n\n\n<li>the stage reached in a multi-step form<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">I would <strong>not<\/strong> use this technique to send names, email addresses, telephone numbers, addresses or other personally identifiable information to Google Analytics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The objective isn&#8217;t to reproduce the contents of your form inside GA4. It&#8217;s to add useful, non-personal context to the event you&#8217;re already using to measure the submission.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Privacy_considerations_when_tracking_form_field_values\"><\/span>Privacy considerations when tracking form field values<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before sending form field values to GA4, think carefully about <strong>what those values contain<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google Analytics shouldn&#8217;t be used to collect personally identifiable information such as names, email addresses, telephone numbers or postal addresses. I&#8217;d also avoid sending free-text form fields where you can&#8217;t control what somebody might enter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This technique is much better suited to predefined, non-personal values where you know exactly what can be submitted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good examples include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>enquiry type<br><\/li>\n\n\n\n<li>product or service category<br><\/li>\n\n\n\n<li>selected package or option<br><\/li>\n\n\n\n<li>yes\/no responses that don&#8217;t reveal sensitive information<br><\/li>\n\n\n\n<li>stages completed within a multi-step process<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A dropdown containing <code>SEO<\/code>, <code>Analytics<\/code> and <code>Website Migration<\/code>, for example, is much easier to safely use as an analytics parameter than a free-text field asking somebody to describe their enquiry.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Just because GTM can access a form field doesn&#8217;t mean you should send its value to Google Analytics.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Decide which values are genuinely useful for analysis, make sure they don&#8217;t identify the person submitting the form, and consider your wider consent and privacy requirements before collecting them. I&#8217;ve covered related implementation considerations in my guide to <a href=\"https:\/\/daveashworth.co\/blog\/a-rough-guide-to-google-consent-mode\/\">Google Consent Mode<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_capture_form_field_values_with_Google_Tag_Manager\"><\/span>How to capture form field values with Google Tag Manager<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original example used a simple form on my website containing several fields. The objective was to capture selected non-personal values when the form was submitted and make them available as variables within GTM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The screenshots below come from that original implementation. The website and form no longer exist in this format, but they demonstrate how the values were exposed to GTM and captured for use in an Analytics event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"679\" height=\"327\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form.png\" alt=\"Test Form\" class=\"wp-image-389\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form.png 679w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form-300x144.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form-150x72.png 150w\" sizes=\"(max-width: 679px) 100vw, 679px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The form fields that you <em>should<\/em> be allowed to track in this case would be job title and the value selected in the drop-down box.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_%E2%80%93_Find_the_form_field_values_in_GTM\"><\/span>Step 1 &#8211; Find the form field values in GTM<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by opening the page containing your form through <strong>GTM Preview mode<\/strong> and submit the form with some test values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Tag Assistant, select the relevant form submission event and inspect the information available to GTM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my original example, the submitted form elements were available within the event data, allowing me to identify the individual fields and their values.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"785\" height=\"813\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_in_data_layer.png\" alt=\"Form Elements in Data Layer\" class=\"wp-image-390\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_in_data_layer.png 785w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_in_data_layer-290x300.png 290w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_in_data_layer-145x150.png 145w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_in_data_layer-768x795.png 768w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The form elements appeared in an array, starting at position <code>0<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name &#8211; <code>cf_name<\/code> &#8211; position 0<\/li>\n\n\n\n<li>Email &#8211; <code>cf_email<\/code> &#8211; position 1<\/li>\n\n\n\n<li>Job Title &#8211; <code>cf_job_title<\/code> &#8211; position 2<\/li>\n\n\n\n<li>Drop Down &#8211; <code>cf_drop_down<\/code> &#8211; position 3<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Name and email were visible to GTM because they formed part of the submitted form, but <strong>that doesn&#8217;t mean they should be sent to Google Analytics<\/strong>. For this example, I only needed the non-personal values relevant to the analysis.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_%E2%80%93_Create_variables_for_the_form_field_values\"><\/span>Step 2 &#8211; Create variables for the form field values<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve identified where the required values are available, you need to make them accessible as variables within Google Tag Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my original implementation, the form elements were available within an array attached to the GTM form submission event. Because arrays start at <code>0<\/code>, I could reference the individual elements by their position.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, the third and fourth elements could be accessed using:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>gtm.element.2.value<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>gtm.element.3.value<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I created Data Layer Variables in GTM for these values so they could subsequently be used within the Analytics event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"758\" height=\"531\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_1.png\" alt=\"Data Layer Variable Config 1\" class=\"wp-image-391\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_1.png 758w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_1-300x210.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_1-150x105.png 150w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"760\" height=\"526\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_2.png\" alt=\"Data Layer Variable Config 2\" class=\"wp-image-392\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_2.png 760w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_2-300x208.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/data_layer_variable_config_2-150x104.png 150w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s worth stressing that this exact variable path <strong>won&#8217;t necessarily apply to every form<\/strong>. How the form data is exposed to GTM depends on the website, form implementation and JavaScript involved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The important part of the process is to use Preview mode to identify where the value you need is available, then create the appropriate GTM variable to retrieve it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After creating the variables, submit the form again with some test values and check that GTM is correctly populating them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"666\" height=\"204\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_filled_in.png\" alt=\"Form Filled In\" class=\"wp-image-393\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_filled_in.png 666w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_filled_in-300x92.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_filled_in-150x46.png 150w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">These are now populated in the data layer variables:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"984\" height=\"86\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/populated_dlvs.png\" alt=\"Populated DLVs\" class=\"wp-image-394\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/populated_dlvs.png 984w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/populated_dlvs-300x26.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/populated_dlvs-150x13.png 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/populated_dlvs-768x67.png 768w\" sizes=\"(max-width: 984px) 100vw, 984px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, both values were now available within GTM and could be passed into an Analytics event when the form was successfully submitted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a current GA4 implementation, I&#8217;d favour predictable values such as dropdowns, radio buttons and other controlled selections rather than unrestricted free-text fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_%E2%80%93_Detect_the_successful_form_submission\"><\/span>Step 3 &#8211; Detect the successful form submission<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Capturing the field values is only half of the setup. We also need to decide <strong>when the GA4 event should fire<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my original example, GTM&#8217;s <strong>Form Submission<\/strong> trigger could detect the form being submitted, so I used that as the trigger for the Analytics event.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"307\" height=\"210\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_trigger.png\" alt=\"Form Submission Trigger\" class=\"wp-image-395\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_trigger.png 307w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_trigger-300x205.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_trigger-150x103.png 150w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then state the conditions on which to fire:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"602\" height=\"450\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form_submission_trigger.png\" alt=\"Test Form Submission Trigger\" class=\"wp-image-397\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form_submission_trigger.png 602w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form_submission_trigger-300x224.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/test_form_submission_trigger-150x112.png 150w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That approach still works for forms that generate a detectable form submission event, but it isn&#8217;t suitable for every website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some forms submit using AJAX and remain on the same page. Others display a success message without generating a conventional form submission event, while some redirect users to a separate thank-you page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on how the form behaves, a successful submission might therefore be detected using:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GTM&#8217;s Form Submission trigger<br><\/li>\n\n\n\n<li>a unique thank-you page<br><\/li>\n\n\n\n<li>an Element Visibility trigger for a success message<br><\/li>\n\n\n\n<li>a custom <code>dataLayer<\/code> event generated when the form succeeds<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The important thing is to trigger your GA4 event from a <strong>genuine successful submission<\/strong>, rather than simply from somebody clicking the submit button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_%E2%80%93_Send_the_form_field_values_to_GA4\"><\/span>Step 4 &#8211; Send the form field values to GA4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once GTM can identify both the successful form submission and the values you want to capture, you can send that information to Google Analytics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I&#8217;d do this using a <strong>GA4 Event tag<\/strong>, with the form values sent as event parameters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you might send an event called:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>form_submit<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">along with a parameter such as:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>enquiry_type<\/code> \u2192 <code>{{DLV - Enquiry Type}}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means GA4 records the successful form submission while the additional parameter provides useful context about the option that was selected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The screenshots below show how I originally implemented this using Universal Analytics. At the time, I created Analytics events using the values captured by the Data Layer Variables.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"757\" height=\"808\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_1.png\" alt=\"Analytics Event via GTM\" class=\"wp-image-398\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_1.png 757w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_1-281x300.png 281w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_1-141x150.png 141w\" sizes=\"(max-width: 757px) 100vw, 757px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"757\" height=\"710\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_2.png\" alt=\"GA Event 2\" class=\"wp-image-399\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_2.png 757w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_2-300x281.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/ga_event_2-150x141.png 150w\" sizes=\"(max-width: 757px) 100vw, 757px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Universal Analytics has since been replaced by GA4, so I wouldn&#8217;t configure the Analytics tags this way today. However, the underlying GTM process hasn&#8217;t fundamentally changed:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>capture the value \u2192 store it in a GTM variable \u2192 detect the successful submission \u2192 send the value with the Analytics event.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main difference is that GA4 uses <strong>events and event parameters<\/strong> rather than the old Universal Analytics Event Category, Action and Label structure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When I submitted the test form, GTM Preview mode confirmed that the required Analytics tags were firing and that the captured values were being passed into them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"602\" height=\"130\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_tags.png\" alt=\"Form Submission Tags\" class=\"wp-image-401\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_tags.png 602w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_tags-300x65.png 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2021\/03\/form_submission_tags-150x32.png 150w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_%E2%80%93_Test_the_form_field_tracking\"><\/span>Step 5 &#8211; Test the form field tracking<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before publishing this type of tracking, test the complete journey in GTM Preview mode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Submit the form using known test values and check that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the successful submission is detected<br><\/li>\n\n\n\n<li>the correct GTM variables are populated<br><\/li>\n\n\n\n<li>the GA4 event fires only after a successful submission<br><\/li>\n\n\n\n<li>the expected event parameters contain the correct values<br><\/li>\n\n\n\n<li>failed or incomplete submissions don&#8217;t generate the event<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For a current GA4 implementation, I&#8217;d also use <strong>DebugView<\/strong> to confirm that the event and its parameters are actually being received by Analytics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t stop testing once you&#8217;ve proved that the tag fires. Try different form options and, where relevant, deliberately trigger validation errors to make sure unsuccessful submissions aren&#8217;t accidentally being recorded as conversions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_analyse_form_field_values_in_GA4\"><\/span>How to analyse form field values in GA4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once the values are being sent as GA4 event parameters, you can use them to add more context to your form submission data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, rather than only knowing that you received 100 form submissions, you might be able to see how those submissions were distributed across different enquiry types, products, services or other predefined options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to use one of these parameters regularly within GA4 reports or Explorations, you may need to register it as an <strong>event-scoped custom dimension<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is why it&#8217;s worth deciding what you actually want to learn <strong>before<\/strong> you start collecting form field values. There&#8217;s little benefit in sending dozens of parameters to GA4 simply because they&#8217;re available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pick a small number of non-personal values that answer a useful question about the people completing the form or the choices they&#8217;re making.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Taking_form_submission_tracking_a_step_further\"><\/span>Taking form submission tracking a step further<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The project that originally prompted this article involved a multi-step application process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Simply tracking the final submission wouldn&#8217;t have provided enough information. The client wanted to understand how users progressed through the application and analyse selected values at different stages of the process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s where this type of tracking becomes particularly useful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of treating the form as a single conversion, you can potentially measure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>which stages users reach<br><\/li>\n\n\n\n<li>where users abandon the process<br><\/li>\n\n\n\n<li>which predefined options are selected<br><\/li>\n\n\n\n<li>how different types of submission progress through the form<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t necessarily need all of that information for a simple contact form. But for longer application, quotation, onboarding or lead-generation processes, it can provide much more useful insight than a single <code>form_submit<\/code> event.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The important part is to be selective. <strong>Track the information you need to answer a genuine analytics question, not every value you can technically extract from the form.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Should_you_track_form_field_values_in_GA4\"><\/span>Should you track form field values in GA4?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For many websites, simply tracking successful form submissions is enough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you only need to know how many enquiries or leads your website generates, there&#8217;s little reason to make the implementation more complicated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Form field tracking becomes useful when the values selected within a form provide additional information you can genuinely use. That might mean understanding different enquiry types, comparing product or service selections, or analysing progression through a multi-step application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google Tag Manager gives you considerable flexibility in how those values are captured, but that doesn&#8217;t mean everything available to GTM belongs in Google Analytics. Stick to carefully selected, non-personal values and avoid sending names, email addresses, telephone numbers, free-text responses or other information that could identify an individual.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The implementation will also vary between websites. Some forms expose their values cleanly to GTM, while others may require a different approach depending on how the form is built and how a successful submission is detected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need help implementing more advanced form tracking, event parameters or other custom analytics measurement, this is the sort of work I regularly handle as a <a href=\"https:\/\/daveashworth.co\/skills\/google-tag-manager-consultant\/\">Google Tag Manager consultant<\/a> and <a href=\"https:\/\/daveashworth.co\/skills\/analytics-and-ad-tracking-consultant\/google-analytics-4\/\">GA4 consultant<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find out how to capture form field submission values via Google Tag Manager and pass as an event to Google Analytics for analytical and reporting purposes.<\/p>\n","protected":false},"author":1,"featured_media":408,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,8],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","category-tag-manager"],"_links":{"self":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":0,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/media\/408"}],"wp:attachment":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}