Form Tracking for Gravity Forms on Google Tag Manager | BCS Form Tracking for Gravity Forms on Google Tag Manager | BCSBCS

Form Tracking for Gravity Forms on Google Tag Manager

Google Tag Manager BCS 1 days ago 14 Views 0 Comments

Update time: January 12, 2025

This article introduces how to track forms in Gravity Forms.

When the form is successfully submitted, gform_confirmation_loaded will be triggered, which can be used to send events, such as:

<script>
jQuery(document).ready( function() {
jQuery(document).bind('gform_confirmation_loaded', function(event, formId){
	window.dataLayer.push({
            'event' : 'gravityFormSubmission',
            'gfformID' : formId		
	});
});
	})
</script>

Now we need to track the form submission in https://www.gravityforms.com/open-support-ticket/general/

Form Tracking for Gravity Forms on Google Tag Manager

Next, let’s see how to implement form tracking:

Step 1 : Custom HTML to inject javascript

In GTM , click「Tags」——「New」——「Choose a tags type to begin setup…」——「Custom HTML」,Name it “HTML – Gravity Forms Listener”, and make the following settings:Form Tracking for Gravity Forms on Google Tag Manager

In fact, it is the jQuery Method. Read more: GA4 Event Tracking Series ⑧ —— Custom Events (jQuery Method)

Step 2 : Set Up the Variables

From the code, we can know that there are data layer variables gfformID in the data layer, which need to be obtained using data layer variables in GTM.

In GTM, click「 Variables」——「New」——「Choose a variable type to begin setup…」——「Data Layer Variable」, name it “dlv-formID”, and then set as follows:、

Form Tracking for Gravity Forms on Google Tag Manager

 

Step 3 : Set Up the Trigger

In GTM , click「Triggers」——「New」——「Choose a trigger type to begin setup…」——「Custom Event」,Name it “Custom Event- Gravity Forms Submit Form”, and make the following settings:

Form Tracking for Gravity Forms on Google Tag Manager

From the code, we can know that the event is gravityFormSubmission, so the event name is set to gravityFormSubmission

Step 4 : Set Up the Tags

In GTM , click「Tags」——「New」——「Choose a tags type to begin setup…」——「Google Analytics: GA4 Event」,Name it “GA4-Event-Gravity Forms Submit Form”, and make the following settings:Form Tracking for Gravity Forms on Google Tag Manager

The event name is submit_form_gravity_forms

Step 5 : Preview and Publish

Next is preview debugging.

Form Tracking for Gravity Forms on Google Tag Manager

Tags is triggered and can be published.

Read More:

Step 6 : Custom Definitions

The next step is to register event parameters form_id, if you want to use it in GA4, you need to register it in the Custom definitions of GA4.

In GA4,click「Admin」——「Custom definitions」——「Create custom dimension」, then do the following configuration:

Form Tracking for Gravity Forms on Google Tag Manager

 

Step 7 : Verify Data in Reports

Generally, after 24 hours, we can see the data in GA4, such as:


If you don't understand, You can leave a comment below.
Like (0)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website