Track RevenueWell Form Submissions in Google Tag Manager

RevenueWell embeds certain forms (such as appointment request or online scheduling forms) inside an iframe. Because of this, standard form submission tracking methods do not work.

Instead, RevenueWell sends form submission data from the iframe to the parent page using the browser’s postMessage API. We can listen for these messages and forward them into Google Tag Manager as a custom event.

Once configured, you will be able to:

  • Detect when a RevenueWell form is submitted
  • Trigger Google Analytics (GA4), Google Ads, or other marketing tags
  • Track conversions reliably from RevenueWell-hosted forms

How RevenueWell Sends Form Events

When a user submits a RevenueWell form, the iframe sends a message event to the parent page.

Appointment Request Form Event Structure

The appointment request form sends an event that includes form data:

{
  "source": "rw",
  "data": {
    "name": "Test User",
    "phone": "(555) 555-5555",
    "email": "test@test.com",
    "dates": "Tue, Nov 21, 2023, Any Time",
    "reason": "Exam & Cleaning",
    "notes": "Test notes"
  },
  "action": "gaEvent",
  "type": "requestAppointment"
}

Online Scheduling Request Event Structure

The online scheduling request form sends a simpler event that does not include form field values, but still indicates that a submission occurred:

{
  "source": "rw",
  "action": "gaEvent",
  "type": "onlineSchedulingRequest"
}

The key identifier in both cases is:

source === "rw"
 

High-Level Implementation Steps

To track these events in Google Tag Manager, we will:

  1. Create a DOM Ready trigger (if one does not already exist)
  2. Create a Custom HTML tag that listens for RevenueWell iframe messages
  3. Push a custom event into GTM (rw-form-submission)
  4. Create a Custom Event trigger in GTM
  5. Attach that trigger to analytics or advertising tags

 

Step 1: Create a DOM Ready Trigger

If you already have a DOM Ready trigger available in your GTM container, you can skip this step.

  1. Open Google Tag Manager
  2. Navigate to Triggers
  3. Click New
  4. Choose Trigger ConfigurationDOM Ready
    DOMtrigger.webp
  5. Select All DOM Ready Events
    2026-01-14_15-18-13.png
  6. Name the trigger (for example: DOM Ready – All Pages)
  7. Save.

This trigger ensures our custom JavaScript is injected after the page has loaded.

Step 2: Create the Custom HTML Tag

Next, we will create a custom tag that listens for messages coming from the RevenueWell iframe and forwards them into Google Tag Manager.

  1. Navigate to Tags in Google Tag Manager
  2. Click New
  3. Under Tag Configuration, select Custom HTML
  4. Paste the following code into the HTML field:
<script>
  window.addEventListener("message", function (event) {
    var submissionEvent = event.data;

    // Ensure the message came from RevenueWell
    if (submissionEvent && submissionEvent.source === "rw") {
      window.dataLayer = window.dataLayer || [];
      window.dataLayer.push({
        event: "rw-form-submission",
        rwEventType: submissionEvent.type || null,
        rwFormData: submissionEvent.data || null
      });
    }
  }, false);
</script>

What This Code Does

  • Listens for message events on the page
  • Verifies the message originated from RevenueWell (source === "rw")
  • Pushes a custom event named rw-form-submission into the GTM data layer
  • Optionally exposes:
    • rwEventType (example: requestAppointment)
    • rwFormData (when available)

Step 3: Attach the DOM Ready Trigger

  1. In the Triggering section of your Custom HTML tag
  2. Select the DOM Ready trigger you created earlier
  3. Save the tag

This ensures the listener is active as soon as the page finishes loading.

2026-01-14_15-46-50.png

Step 4: Create a Custom Event Trigger

Now we will create a trigger that fires when the custom event is pushed into GTM.

  1. Navigate to Triggers
  2. Click New
  3. Choose Trigger ConfigurationCustom Event
  4. Set Event name to: "rw-form-submission"
  5. Leave the trigger set to All Custom Events.
  6. Name the trigger (for example: RW Form Submission)
  7. Save

Step 5: Confirm the Setup Is Working

You can verify the implementation using Google Tag Assistant or GTM Preview mode.

  1. Enable Preview mode in Google Tag Manager.
  2. Open your website.
  3. Submit a RevenueWell form.
  4. In the Tag Assistant debug panel, confirm:
    • A custom event named rw-form-submission appears in the event timeline
    • Any tags attached to the trigger fire as expected

If you see the custom event, the integration is working correctly.

2026-01-14_16-02-45.png

By completing these steps, you:

  • Enable reliable tracking for RevenueWell iframe-based forms.
  • Create a reusable GTM trigger that fires on every form submission.
  • Give your marketing and analytics tools visibility into RevenueWell conversions.

This setup can be safely shared with third-party vendors and reused across sites that embed RevenueWell forms.