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:
- Log in to Google Tag Manager.
- Navigate to Tags and click New.
- Name it WPForms Data Layer Script.
- Select Tag Type: Custom HTML.
- Paste the following script inside the HTML box:
- Set the Trigger to All Pages.
- Click Save and publish the container.
Step 2: Create a Custom Event Trigger in GTM
- Log in to Google Tag Manager.
- Navigate to Triggers and click New.
- Name the trigger WPForms Submission.
- Select Trigger Type: Custom Event.
- Set the Event Name to “
wpform_submission"
. - Choose All Custom Events.
- Click Save.
Step 3: Create a GA4 Event Tag in GTM
- Go to Tags and click New.
- Name the tag GA4 – WPForms Submission.
- Select Tag Type: GA4 Event.
- Choose your GA4 Configuration Tag.
- Set the Event Name to
generate_lead
. - Click Triggering and select WPForms Submission.
- Save the tag.
Step 4: Test the Setup in GTM
- Click Preview in GTM and enter your website URL.
- Submit a test WPForms form.
- Check if the “
wpform_submission"
event appears in Tag Assistant. - Ensure the GA4 event fires successfully.
Step 5: Publish the GTM Container
- If everything works as expected, click Submit in GTM.
- Add a version name and description.
- Click Publish.
Step 6: Verify the Data in GA4
- Open GA4 and go to Admin > DebugView.
- Look for the
generate_lead
event. - Click on the event to check if it is being recorded.
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