Tracking Google Analytics 4 (GA4) Hubspot Forms Submission using Google Tag Manager

Standard

Conversions Tracking HubSpot Forms Submission in Google Analytics 4 (GA4) using Google Tag Manager

Tracking HubSpot Form Submissions in Google Analytics 4 (GA4) allows businesses to gather valuable insights into how users interact with their forms and make data-driven decisions to improve the user experience. To track form submissions in GA4, you need to set up GA4 tracking on your website and integrate it with HubSpot forms using Google Tag Manager (GTM).

HubSpot form submissions refer to the process of filling out and submitting a form on a website that is powered by the HubSpot platform. When a user submits a form, the data they entered is collected and stored in HubSpot, where it can be used for various purposes, such as lead generation, marketing automation, and sales enablement.

To track HubSpot forms in Google Analytics 4 (GA4), you can follow these steps:

  • Create a GA4 property and a GA4 tag in Google Tag Manager (GTM).
  • Add the GA4 tag to your website.
  • Copy the HubSpot form tracking code from your HubSpot account and paste it into GTM.
  • Create a trigger in GTM to track form submissions in GA4.
  • Test the form submissions in GA4 by navigating to the “Events” report.

Here’s an example of a trigger in GTM to track form submissions in GA4:

  • Go to GTM and click on “Triggers.”
  • Click on the “New” button to create a new trigger.
  • Give the trigger a name, such as “HubSpot Form Submission.”
  • Select “Custom Event” as the trigger type.
  • Enter “formSubmission” as the event name.
  • Save the trigger.

Here is an example of a HubSpot data layer script code that can be used to push form submission data to the data layer:

<script>
  hbspt.forms.create({
    target: '#your-form-container',
    onFormSubmit: function($form) {
      var data = {
        event: 'form_submission',
        form_id: $form.attr('id'),
        form_name: $form.find('.hs-form-name').text().trim()
      };
      window.dataLayer = window.dataLayer || [];
      window.dataLayer.push(data);
    }
  });
</script>

This script pushes a data object to the data layer when a form submission is confirmed. The data object contains information about the form ID and form name, which can be used in GTM tags and triggers.

Note: This is a basic example, and you can modify it to include additional information about the form submission such as field values, user information, and more. You will need to replace “your-portal-id” and “your-form-id” with the actual values from your HubSpot account.

Disclaimer: Google tag manager belongs to Google property 

For Contact: mappchero@gmail.com

I am available for Hire on Freelancer: Freelancer.com

I am available for Hire on Upwork: Upwork.com

I am available for Hire on Peopleperhour: Peopleperhour.com

I am available for Hire on Guru: Guru.com

Leave a Reply

Your email address will not be published. Required fields are marked *