How to Track WS Form Submissions in GA4 Using Google Tag Manager

Track Ws form in GA4 using GTM

Tracking WS Form submissions accurately in Google Analytics 4 (GA4) is critical if you want reliable lead and conversion data.
However, if you’re using WS Form on your WordPress website, GA4 will not track submissions automatically.

Why?
Because WS Form submits data using AJAX, meaning the page does not reload after submission. As a result, GA4 never receives a clear signal that a form was successfully submitted.

The most reliable solution is to track WS Form submissions using Google Tag Manager (GTM) by listening to WS Form’s native JavaScript success event and sending that data directly to GA4.

This guide walks you through the recommended and accurate method.

Why GA4 Cannot Track WS Form Automatically

GA4 works best when:

  • A page reload occurs, or
  • A predefined event is triggered

WS Form does neither by default.

Instead:

  • The form submits silently via AJAX
  • A success message is displayed
  • The URL remains unchanged

Because of this, GA4 has no built-in signal to record the submission.
That’s where Google Tag Manager becomes essential.

Recommended Method: Track WS Form Using the Success Event Listener

WS Form fires a JavaScript event only after a successful submission.
By listening to this event, you ensure:

  • ✅ Only valid submissions are tracked
  • ❌ Failed or incomplete submissions are ignored
  • 📊 Conversion data stays clean and accurate

Step 1: Add the WS Form Success Listener in Google Tag Manager

WS Form triggers a JavaScript event on successful submission.
We’ll capture that event and push a custom event into the GTM data layer.

Steps in GTM:

1. Go to Google Tag Manager → Tags → New

2. Select Custom HTML

3. Add the following code:

<script>

(function () {

// Ensure jQuery is available

if (typeof jQuery === ‘undefined’) {

console.error(‘jQuery is required for WSForm event tracking.’);

return;

}

 

// Function to push events to dataLayer

function pushToDataLayer(eventType, formObject, formId, instanceId) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

event: eventType,

form_id: formId,

instance_id: instanceId,

form_object: formObject,

event_type: eventType

});

console.log(‘Pushed to dataLayer:’, eventType, formId, instanceId);

}

 

// Attach event listeners

jQuery(document).on(‘wsf-submit-before’, function (event, formObject, formId, instanceId) {

pushToDataLayer(‘wsform_submit_clicked’, formObject, formId, instanceId);

});

 

jQuery(document).on(‘wsf-submit-success’, function (event, formObject, formId, instanceId) {

pushToDataLayer(‘wsform_submit_success’, formObject, formId, instanceId);

});

 

jQuery(document).on(‘wsf-submit-error’, function (event, formObject, formId, instanceId) {

pushToDataLayer(‘wsform_submission_error’, formObject, formId, instanceId);

});

console.log(‘WSForm event listeners initialized.’);

})();

</script>

Trigger:

  • DOM Ready

Tag Name:
👉 Forminator – Success Listener

Step 2: Create a Custom Event Trigger

Now we tell GTM to react when the data layer event fires.
Steps:
1. Go to Triggers → New
2. Choose Custom Event

Configuration:

  • GA4 Configuration Tag: Select your existing GA4 config tag
  • Event Name:

wsform_form_submit

Advanced Settings (Recommended):

  • Tag firing options → Once per page

Tag Name:
👉 GA4 Event – WS Form Submission

Trigger:

  • WS Form – Form Success Trigger

Step 3: Create a Custom Event Trigger

Now we tell GTM to react when the data layer event fires.

Steps:

1. Go to Triggers → New

2. Choose Custom Event

Event Name:

wsform_form_success

Trigger fires on:

  • All Custom Events

Trigger Name:
👉 WS Form – Form Success Trigger

  • GTM → Custom Event trigger setup screen

Step 4: Test the Setup Using GTM Preview Mode

Before publishing, testing is critical.

Steps:

  1. Click Preview in GTM
  2. Open your website in Tag Assistant
  3. Submit a WS Form

What to Check:

  • Look for the event wsform_form_success
  • Confirm GA4 Event – WS Form Submission fires successfully

If the tag fires, your setup is working correctly.

Step 5: Verify the Event in GA4 DebugView

Finally, confirm that GA4 is receiving the event.

Steps:

  1. Open GA4
  2. Go to Admin → DebugView
  3. Submit the form again

 

You should see:

wsform_form_submit

Once verified, mark this event as a conversion in GA4.

Why This Method Is the Best Choice

  • ✔ Tracks only successful submissions
  • ✔ Avoids false or duplicate conversions
  • ✔ Works perfectly with AJAX-based WS Forms
  • ✔ Fully aligned with GA4 best practices

Compared to button-click or thank-you-page tracking, this approach is far more accurate and future-proof.

Final Thoughts

If you’re using WS Form and depending on GA4 for lead tracking, proper event-based tracking is essential. Without it, form conversions are either missed or misreported.

At Incisive Ranking, we implement analytics solutions focused on accuracy, scalability, and actionable insights. This WS Form tracking setup gives you a solid foundation for reliable lead measurement and marketing attribution.

Follow Us:

About Us

We are experts in Tags and Tracking Services. With experience in eCommerce and Custom Conversion tracking, Server Side Tagging, and Data tracking to help you get the advantage of ACCURATE data for better decision making. With more than 6 years of experience, We have already delivered more than 500 projects.