FreeGoogle Tag Manager recipes

Track Duda Form Submissions in Google Tag Manager with this Free GTM Recipe

A free, tested Google Tag Manager recipe that captures Duda form submissions and turns them into a trigger you can use to fire conversions to Google Ads, Google Analytics and more.

Aaron Beashel
Aaron BeashelUpdated September 20267 min read
The Duda recipe tag inside Google Tag Manager

Google Tag Manager is a common way to send conversions to Google Ads, Google Analytics, etc when someone submits a Duda form on your website.

The problem is, it's quite difficult to set up. Duda runs two different form widgets, an older Contact Form and a newer Advanced Forms builder, and neither one submits with a plain HTML post that Google Tag Manager's built-in trigger can catch. The only reliable signal is Duda's own site JavaScript API, which you have to subscribe to correctly and only treat as a conversion once it confirms a real success, so you're left having to write custom code to detect the form submission, send an event to the dataLayer, and build a trigger on top of that.

And unless you're a developer or very experienced with Google Tag Manager, you're going to struggle.

Fortunately though, there is a simple solution.

You can simply install this Duda Conversion Tracking Recipe in your Google Tag Manager account and you'll have everything you need to get basic conversion tracking set up.

What Is a Google Tag Manager Recipe and What's in It?

A recipe is a pre-built bundle of Google Tag Manager assets (a tag, a trigger and a variable) that you import in one go instead of building each piece yourself. You can see all our recipes and how they work in the GTM recipe library.

This recipe detects successful Duda form submissions, sends a 'Form Submitted' event to Google Tag Manager, and gives you a Trigger you can use to send conversions to Google Analytics, Google Ads, etc. There are three parts to it, and nothing inside is hidden. Here's exactly what each piece contains, so you can see what you're importing before you import it.

Custom HTML Tag

Listens for confirmed Duda form submissions, on both the older Contact Form widget and the newer Advanced Forms builder, and pushes a 'duda_form_submitted' event to the dataLayer. It fires on All Pages, once per event, and this is the code inside it.

The Tag's CodeJavaScript · 69 lines
(function () {
  if (window.__converlyRecipeDuda) return;
  window.__converlyRecipeDuda = true;
  window.dataLayer = window.dataLayer || [];

  var armed = false;
  var fastPoll = null;
  var slowPoll = null;

  function stopPolling() {
    if (fastPoll) { clearInterval(fastPoll); fastPoll = null; }
    if (slowPoll) { clearInterval(slowPoll); slowPoll = null; }
  }

  function fireConversion(fields) {
    var count = 0;
    try {
      if (fields && typeof fields.length === 'number') count = fields.length;
    } catch (e) {
      count = 0;
    }
    window.dataLayer.push({
      event: 'duda_form_submitted',
      // Duda's event carries no form id or name (see the notes above), so this
      // is the only signal that separates, say, a 2-field newsletter box from
      // a 6-field quote form on the same page. It is form structure, never
      // visitor data.
      field_count: count
    });
  }

  function arm() {
    if (armed) return true;
    var api = window.dmAPI;
    if (!api || typeof api.subscribeEvent !== 'function') return false;
    if (!api.EVENTS || !api.EVENTS.FORM_SUBMISSION) return false;
    try {
      api.subscribeEvent(api.EVENTS.FORM_SUBMISSION, function (fields) {
        try {
          fireConversion(fields);
        } catch (e) {
          // Never throw back into Duda's own event dispatch.
        }
      });
    } catch (e) {
      // dmAPI can be half-initialised: the members exist but subscribing
      // throws. Stay unarmed and let the poll try again, rather than marking
      // ourselves armed with no listener attached and going silent forever.
      return false;
    }
    // Only now. Setting this before the call means a throw leaves us
    // permanently "armed" with nothing listening.
    armed = true;
    return true;
  }

  if (!arm()) {
    // Duda's runtime usually exists before GTM injects this tag, but a slow
    // connection or a lazily rendered section can reverse that. Poll quickly
    // for the first 20 seconds, then keep trying slowly for the life of the
    // page rather than giving up: a form that appears late (a popup, a section
    // below a slow hero) would otherwise never be tracked, silently.
    fastPoll = setInterval(function () { if (arm()) stopPolling(); }, 100);
    slowPoll = setInterval(function () { if (arm()) stopPolling(); }, 2000);
    setTimeout(function () {
      if (fastPoll) { clearInterval(fastPoll); fastPoll = null; }
    }, 20000);
  }
})();

Variable

Captures how many fields were included in the submission, ready to reference in any tag. These are its exact settings.

Name

DLV - Duda Field Count

Variable Type

Data Layer Variable

Data Layer Variable Name

field_count

Trigger

Fires when the 'duda_form_submitted' event is received. Use it as the trigger for any conversion tag. These are its exact settings.

Name

CE - Duda Form Submitted

Trigger Type

Custom Event

Event Name

duda_form_submitted

Download This Recipe

Get the ready-to-import file and upload it into Google Tag Manager. Everything shown above (the tag, the variable and the trigger) comes pre-built inside.

Built from Converly's own Duda detection code

Why It's the Best Recipe Out There

It is built from the same detection code we use in our own conversion tracking product, Converly, just adapted to run inside Google Tag Manager.

Fires only on a genuine success. It subscribes to Duda's own form submission event and never fires on a blocked validation attempt, a failed reCAPTCHA or a submission Duda's server refuses outright.
Covers both of Duda's form widgets, the older Contact Form and the newer Advanced Forms builder, with a single listener, because both emit the same underlying event.
Live-verified on 2 September 2026 against a real Duda site, including a multi-step Advanced Form (fires once, on the final step, carrying every field from every step) and a form set to redirect (fires before the browser navigates away).
Tested through the same QA process our own conversion tracking product goes through, and used to detect thousands of Duda submissions by Converly customers.

How to Use the Duda GTM Recipe

1

Install the Recipe

Download the recipe using the form above, then import it into your Google Tag Manager container. In GTM, head to Admin, choose Import Container, select the downloaded file, and pick the Merge option so it doesn't overwrite anything already in your container. The listener, variable and trigger are added for you automatically.

Importing the recipe container in Google Tag Manager
2

Configure Your Tags

Now that the recipe is installed, you can use it as a Trigger for your conversion tags. Here are two common examples.

Example 1: Google Analytics

Create a GA4 event tag and set the recipe's trigger (called CE - Duda Form Submitted) as its firing trigger. Every Duda form submission now sends an event to Google Analytics.

A GA4 event tag using the recipe's trigger

Example 2: Google Ads

Add your Google Ads conversion tag and fire it on the recipe's trigger to report form fill conversions back to your campaigns.

A Google Ads conversion tag using the recipe's trigger

What This Enables You to Do (and What It Doesn't)

This recipe fires an event in Google Tag Manager whenever a successful Duda form submission is detected, on either of Duda's form widgets. You can use that as a trigger to send conversions to Google Ads, Google Analytics and other tags.

What it does

Sends an Event to GTM

Detects successful Duda form submissions, on both the older Contact Form widget and the newer Advanced Forms builder, and pushes an event called 'duda_form_submitted' into your dataLayer automatically.

Tells You How Many Fields Were Submitted

Passes the number of fields included in the submission alongside the event, so you can tell a short newsletter box from a longer quote form even without a form name.

Creates a Trigger in GTM

Gives you a 'Trigger' in Google Tag Manager which you can use as the trigger for any of your conversion tags.

What it doesn't do

Doesn't send the conversion server-side

Everything fires client-side, so ad blockers can stop the tag loading and browser privacy restrictions can limit tracking to as little as a day.

No Click IDs or Identifiers

It does not capture the Google click ID, Facebook click ID, Meta pixel cookies, IP address or user agent, which ad platforms need for Enhanced Conversions (Google) or a proper Event Match Quality score (Meta).

No Personal Details

The script only fires an event. It does not capture the lead's name, email or phone number, all of which Google and Meta require for enhanced conversions and a high match score.

No Logging or Notifications

You can test it with Tag Assistant on install, but unless you check every week you have no way of knowing if it quietly breaks.

Can't Tell Which Form Fired

Duda's own event carries no form ID or name, a gap in the platform rather than something this recipe can work around, so a page with more than one Duda form can't be split apart from the event alone. GTM's built-in Page Path variable is the reliable way to separate them.

The Proper Way to Send Conversions to Google Ads, Meta Ads & More

This recipe is fine if you only send events to Google Analytics, which does not accept personal information or IP addresses. But to get a good Event Match Quality (EMQ) score in Meta, or use Enhanced Conversions in Google, you need to send the data server-side, together with the lead's name and email. That is what Converly does.

A Converly workflow sending Duda conversions to ad platforms

Here's why Converly is the best way to send conversions to Google Ads, Meta Ads, Microsoft Ads, LinkedIn Ads, etc.

Easy to set up

Converly gives you a simple drag-and-drop builder you can use to build a Conversion Flow. Simply select a trigger (like a Duda form being submitted) and then select your actions (like sending a conversion to Google Ads). No custom code, no complex configuration.

Sends Data Server-Side

Converly sends conversions directly from its servers to Google, Meta and the rest, instead of through the visitor's browser, so ad blockers and privacy restrictions can't get in the way.

Sends More Data

It captures the lead's name, email and phone plus the Google and Facebook click IDs, IP address and user agent, and sends them with every conversion. That enables Enhanced Conversions in Google Ads, or gives you an Event Match Quality (EMQ) score of 9 or 10 in Meta.

Full Conversion Log & Email Notifications

See every conversion, what was captured, what was sent to each platform and whether it was received. Get email alerts so tracking can't break without you knowing.

Supports Multiple Tools & Destinations

Detects submissions across 80+ form, scheduling and chat tools and sends to 20+ destinations including Google Ads, Meta, LinkedIn, Microsoft and TikTok. So if you ever add a new tool or start advertising on a new platform, it's just a few clicks.

Provides Free Support

Our team has 20 years of experience in conversion tracking and analytics and is here to help whenever you need it. With Google Tag Manager, you're on your own.

Start Your Free Trial

Start a 14-day free trial and track your conversions the proper way. No code, no complicated configuration.

About the author

Aaron Beashel
Aaron Beashel

Aaron is the founder of Converly. With over 15 years of experience in digital marketing and SaaS, he's passionate about helping businesses track and optimise their ad conversions.

Start your free trial

Easily send conversions to your ad platforms and analytics tools.
No code required.