Widget Conversion Tracking

Track widget form submissions as conversions in Google Ads, Meta (Facebook) Pixel, GA4, or any other platform using Google Tag Manager. This guide walks you through setup step-by-step.


Prerequisites

Before you begin:

  • Google Tag Manager must be installed on the same page where your widget is embedded
  • Your widget embed code should already be on the page (the script and container div)

If GTM is not on the page, the widget still emits events, but nothing will capture them.


How It Works

The widget automatically pushes events to your page's dataLayer when users interact with the form. No extra configuration is needed on the widget itself — events are always emitted.

Widget (iframe) → postMessage → Host page (widget.js) → dataLayer.push() → GTM

When a visitor submits the form, an event is pushed to dataLayer. GTM listens for that event and fires your conversion tag (Google Ads, Meta Pixel, etc.).


Available Events

Event NameWhen It FiresUse Case
llm_widget_form_startUser clicks into a form fieldMeasure engagement / intent
llm_widget_form_submitLead successfully createdPrimary conversion event
llm_widget_form_duplicateUser already submitted this monthIdentify returning visitors
llm_widget_form_errorForm submission failedMonitor error rates

Event Data

Each event includes additional data you can use in your tags:

Variable NameAvailable OnDescription
llm_widget_keyAll eventsYour widget identifier
llm_widget_error_typeform_error onlyvalidation, server, or network

Part A: GTM Foundation (Do This First)

These steps are required before setting up Google Ads or Meta Pixel.

Step 1: Create a Custom Event Trigger

  1. Open your Google Tag Manager container
  2. Go to Triggers in the left sidebar
  3. Click New
  4. Click the trigger configuration area
  5. Choose trigger type: Custom Event
  6. In Event name, enter exactly: llm_widget_form_submit
  7. Name the trigger (e.g. "Widget Lead Submit")
  8. Click Save

Important

The event name must match exactly. Copy and paste: llm_widget_form_submit

Step 2: (Optional) Create Data Layer Variables

If you want to pass the widget key to your conversion tag:

  1. Go to Variables in the left sidebar
  2. Click New
  3. Choose variable type: Data Layer Variable
  4. Set Data Layer Variable Name to: llm_widget_key
  5. Name it "Widget - Key"
  6. Click Save

Part B: Google Ads Conversion Tracking

Follow Google's official setup to create your conversion action and get your Conversion ID and Label:

Widget-specific: When creating your Google Ads Conversion tag in GTM, set the trigger to Widget Lead Submit (the trigger you created in Part A).


Part C: Meta (Facebook) Pixel Conversion Tracking

Follow Meta's official setup to install the Pixel and configure Lead events:

Widget-specific: When creating your Lead event tag in GTM (Meta Pixel tag or Custom HTML), set the trigger to Widget Lead Submit (the trigger you created in Part A). The event to fire is Lead.


Testing Your Setup

  1. In GTM, click Preview to enter debug mode
  2. Enter your website URL (the page where the widget is embedded)
  3. Click Connect
  4. On your site, interact with the widget:
    • Click into a form field → you should see llm_widget_form_start in the GTM debug panel
    • Submit the form → you should see llm_widget_form_submit
  5. Verify your conversion tags fired on the correct events
  6. Once confirmed, Publish your GTM container

Quick Check: dataLayer in Console

Open the browser console on the page with the widget and run:

console.log(window.dataLayer);

You should see entries like:

{ event: "llm_widget_form_start", llm_widget_key: "your_key" }
{ event: "llm_widget_form_submit", llm_widget_key: "your_key" }

Troubleshooting

Events not showing in GTM Preview

  • Make sure GTM is installed on the same page as the widget embed script
  • Check that the widget is loading correctly (you should see the form)
  • Open the browser console and check window.dataLayer for entries

Conversion tag not firing

  • In GTM Preview, check that your trigger matches the event name exactly: llm_widget_form_submit
  • Make sure the tag is associated with the correct trigger
  • Check for any trigger exceptions that might be blocking it

Events fire but conversions not showing in Google Ads / Meta

  • Conversions can take up to 24 hours to appear in ad platform dashboards
  • Verify the conversion tag has the correct Conversion ID / Pixel ID
  • Check the platform's own diagnostics (Google Ads conversion diagnostics, Meta Events Manager)

Privacy Notes

  • The widget does not include email addresses in any tracking events
  • Only the widget key (an opaque identifier) is included
  • No cookies are set by the widget
  • All tracking runs through your GTM container on your page, covered by your existing cookie consent setup