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 Name | When It Fires | Use Case |
|---|---|---|
llm_widget_form_start | User clicks into a form field | Measure engagement / intent |
llm_widget_form_submit | Lead successfully created | Primary conversion event |
llm_widget_form_duplicate | User already submitted this month | Identify returning visitors |
llm_widget_form_error | Form submission failed | Monitor error rates |
Event Data
Each event includes additional data you can use in your tags:
| Variable Name | Available On | Description |
|---|---|---|
llm_widget_key | All events | Your widget identifier |
llm_widget_error_type | form_error only | validation, 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
- Open your Google Tag Manager container
- Go to Triggers in the left sidebar
- Click New
- Click the trigger configuration area
- Choose trigger type: Custom Event
- In Event name, enter exactly:
llm_widget_form_submit - Name the trigger (e.g. "Widget Lead Submit")
- 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:
- Go to Variables in the left sidebar
- Click New
- Choose variable type: Data Layer Variable
- Set Data Layer Variable Name to:
llm_widget_key - Name it "Widget - Key"
- 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
- In GTM, click Preview to enter debug mode
- Enter your website URL (the page where the widget is embedded)
- Click Connect
- On your site, interact with the widget:
- Click into a form field → you should see
llm_widget_form_startin the GTM debug panel - Submit the form → you should see
llm_widget_form_submit
- Click into a form field → you should see
- Verify your conversion tags fired on the correct events
- 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.dataLayerfor 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