How to track WPForms Conversion with GTM and GA4

Introduction

Tracking form submissions is essential for understanding user interactions and optimizing conversion rates. If you are using WPForms on your WordPress website, you can track form submissions using Google Tag Manager (GTM) and send the data to Google Analytics 4 (GA4). In this guide, I’ll show you how to set up WPForms conversion tracking using a data layer script that sends event data to GTM, and then configure GTM to send the data to GA4.

Why Should We Track Forms in GA4?

Tracking form submissions in GA4 allows you to:

  • Measure the effectiveness of your lead generation forms.
  • Identify form abandonment issues and improve conversions.
  • Attribute form submissions to traffic sources for better marketing decisions.
  • Understand user interactions and optimize the customer journey.

Prerequisites

Before starting, ensure you have:

  • A WordPress website with WPForms installed.
  • Google Tag Manager (GTM) installed on your website.
  • GA4 Property set up and linked to your website.

πŸš€ Need Help with WPForms Tracking?

If you need the data layer script, help with setup, or face any issues, I can assist you.

βœ… Hire Me for Setup: WhatsApp Me

βœ… Book a Consultation: Schedule a Call

Step 1: Add the Data Layer Script Using GTM

To track WPForms submissions, you need a script that pushes form submission events to the data layer. Instead of adding it directly to your website, add it using a Custom HTML Tag in GTM:

  1. Log in to Google Tag Manager.
  2. Navigate to Tags and click New.
  3. Name it WPForms Data Layer Script.
  4. Select Tag Type: Custom HTML.
  5. Paste the following script inside the HTML box:
  6. Set the Trigger to All Pages.
  7. Click Save and publish the container.

Wpforms listener code

Step 2: Create a Custom Event Trigger in GTM

  1. Log in to Google Tag Manager.
  2. Navigate to Triggers and click New.
  3. Name the trigger WPForms Submission.
  4. Select Trigger Type: Custom Event.
  5. Set the Event Name to “wpform_submission".
  6. Choose All Custom Events.
  7. Click Save.

Wp form submission custom event

Step 3: Create a GA4 Event Tag in GTM

  1. Go to Tags and click New.
  2. Name the tag GA4 – WPForms Submission.
  3. Select Tag Type: GA4 Event.
  4. Choose your GA4 Configuration Tag.
  5. Set the Event Name to generate_lead.
  6. Click Triggering and select WPForms Submission.
  7. Save the tag.

GA4 form submission Tag

Step 4: Test the Setup in GTM

  1. Click Preview in GTM and enter your website URL.
  2. Submit a test WPForms form.
  3. Check if the “wpform_submission" event appears in Tag Assistant.
  4. Ensure the GA4 event fires successfully.

Form submission Tag Status

Step 5: Publish the GTM Container

  1. If everything works as expected, click Submit in GTM.
  2. Add a version name and description.
  3. Click Publish.

Step 6: Verify the Data in GA4

  1. Open GA4 and go to Admin > DebugView.
  2. Look for the generate_lead event.
  3. Click on the event to check if it is being recorded.

GA4 debug generate lead event

Conclusion

By following these steps, you have successfully set up WPForms conversion tracking using Google Tag Manager and sent the data to GA4. This will help you analyze form performance and optimize your marketing efforts.

πŸš€ Need Help with WPForms Tracking?

If you need the data layer script, help with setup, or face any issues, I can assist you.

βœ… Hire Me for Setup: WhatsApp Me

βœ… Book a Consultation: Schedule a Call

For more insightful guides and tips on conversion tracking and digital marketing, check out my otherΒ Blogs Here

Author

Md Zubayer Islam
Marketing Data Analyst

LinkedIn
Facebook
Twitter

Leave a Comment

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