Form Builders Free basic code Advanced version available

JetFormBuilder GTM Event Listener

Free JetFormBuilder tracking code for GTM. Fires jet_form_submit once per accepted form, for AJAX and page reload forms and redirects. GA4 and Ads ready.

JetFormBuilder GTM Event Listener
Free code

Free JetFormBuilder GTM listener code

Copy this into a Custom HTML tag in Google Tag Manager. It pushes jet_form_submit to the dataLayer when the JetFormBuilder form is sent.

GTM Custom HTML · JetFormBuilder
<script>
/* JetFormBuilder listener by MD Niamul - mdniamul.com
   Fires jet_form_submit once per JetFormBuilder form that the server
   accepts. AJAX forms: JetFormBuilder's own
   'jet-form-builder/ajax/on-success' event. Page reload forms: the
   result page (status=success, or the Redirect to Page target).
   Works when GTM loads before jQuery, never touches XMLHttpRequest,
   and never sends what people typed. */
(function () {
  if (window.__mdnJetFormBasic) return; // tag fired twice: keep one copy
  window.__mdnJetFormBasic = true;
  window.dataLayer = window.dataLayer || [];
  var EVENT = 'jet_form_submit', KEY = 'mdn_jfb_pending', last = {};

  function push(id, type) {
    var k = id + '|' + type;
    if (!id || (last[k] && new Date().getTime() - last[k] < 1500)) return; // one push per submit
    last[k] = new Date().getTime();
    window.dataLayer.push({ event: EVENT, form_id: String(id), submit_type: type, page_path: window.location.pathname });
  }

  // 1) AJAX forms. JetFormBuilder triggers this jQuery event only when
  //    the server answers status "success", before any redirect.
  (function bind(tries) {
    var $ = window.jQuery;
    if (!$ || !$.fn || !$.fn.on) { if (tries < 300) setTimeout(function () { bind(tries + 1); }, 100); return; }
    $(document).on('jet-form-builder/ajax/on-success', function (e, response, $form) {
      try {
        var form = $form && $form[0];
        push((form && form.getAttribute('data-form-id')) || (form && form.querySelector('[name="_jet_engine_booking_form_id"]') || {}).value, 'ajax');
      } catch (err) {}
    });
  })(0);

  // 2) Page reload forms. The submit is only remembered when the form
  //    really posts (JetFormBuilder's own checks passed), then sent on
  //    the page the server sends back.
  var posting = null;
  document.addEventListener('submit', function (e) {
    var f = e.target;
    if (!f || !f.matches || !f.matches('form.jet-form-builder.submit-type-reload')) return;
    posting = { form: f, native: false };
    setTimeout(function () { if (posting && posting.form === f && !e.defaultPrevented) posting.native = true; }, 0);
  }, true);
  window.addEventListener('pagehide', function () {
    if (!posting || !(posting.native || posting.form.classList.contains('is-loading'))) return;
    try { sessionStorage.setItem(KEY, JSON.stringify({ id: posting.form.getAttribute('data-form-id'), at: new Date().getTime() })); } catch (err) {}
  });
  try {
    var p = JSON.parse(sessionStorage.getItem(KEY) || 'null');
    sessionStorage.removeItem(KEY);
    var status = new URLSearchParams(window.location.search).get('status');
    // JetFormBuilder adds ?status=... on its result page; a failed or
    // invalid submit always has a status other than "success".
    if (p && new Date().getTime() - p.at < 5 * 60 * 1000 && (status === 'success' || status === null)) push(p.id, 'reload');
  } catch (err) {}
})();
</script>

This code is also on GitHub with a README and version history: github.com/mdniamul0/jetformbuilder-gtm-listener

GTM triggerCustom EventEvent namejet_form_submit
Quick install in 3 steps
  1. In GTM, go to Tags → New → Custom HTML, click Copy code above and paste it in.
  2. Set the trigger to All Pages and save the tag.
  3. Create a Custom Event trigger named jet_form_submit, use it on your GA4, Google Ads or Meta tag, then Preview and Publish.
See the full step-by-step guide
Example output

What you’ll see in GTM Preview

After you install the code and send a test entry, this is the data that shows up in GTM. You don’t need to paste it anywhere. Use it to check the listener works and to create Data Layer Variables such as form_id.

Example: dataLayer outputExample only. You don’t paste this anywhere.
{
  event: 'jet_form_submit',
  form_id: '87',
  submit_type: 'ajax',
  page_path: '/contact/'
}
Step by step

How to set up the JetFormBuilder listener in GTM

How to install the free JetFormBuilder listener

  1. Keep your JetFormBuilder forms as they are. The listener works with both submit types in the form settings: AJAX and Page Reload, with a success message or a Redirect to Page action, and with forms in Elementor, JetPopup or the block editor.
  2. Add the code to GTM. In Google Tag Manager go to Tags → New → Custom HTML, paste the free code from this page and set the trigger to All Pages. GTM can load before jQuery, and the code never changes XMLHttpRequest.
  3. Create the trigger. Go to Triggers → New → Custom Event and type jet_form_submit. To track one form only, add the condition form_id equals your form’s ID (the number in the shortcode or the form edit URL).
  4. Add the variables. Create Data Layer Variables for form_id and submit_type (ajax or reload).
  5. Add your conversion tag. Fire your GA4 event (for example generate_lead), Google Ads conversion or Meta Pixel Lead event on the jet_form_submit trigger.
  6. Test and publish. Open GTM Preview, submit once with a required field empty (no event), then a real test entry, and check that jet_form_submit shows up once. Page reload forms show the event on the page you land on after the submit. Then publish your container.

Good to know: AJAX forms use JetFormBuilder’s own jet-form-builder/ajax/on-success event, and page reload forms are confirmed on the result page (status=success or your redirect page), so the event only fires when the server accepts the form. The free code never sends what people typed, so nothing personal reaches GA4.

Want the full GA4 setup? Read my guide on WordPress form tracking in GA4 with GTM. If you’d rather have it done for you, see my Google Ads tracking specialist page and my server-side tracking service.

Compare

Basic vs advanced JetFormBuilder listener

The free code tells GTM that a lead happened. The advanced code tells your ad platforms who the lead is and where they came from.

What you getBasic FreeAdvanced Paid
Fires only on a successful submit or bookingYesYes
Form or platform ID in the dataLayerYesYes
UTM source, medium, campaign, term and contentNoYes
Ad click IDs (gclid, wbraid, gbraid, fbclid, ttclid, msclkid)NoYes
SHA-256 hashed email, phone and nameNoYes
First-party cookies (_fbp, _fbc, _ga, _gcl_aw)NoYes
Device, browser and visitor locationNoYes
event_id for Pixel and CAPI deduplicationNoYes
Ready for Google Ads Enhanced Conversions and Meta CAPINoYes
Install help from MD NiamulNoYes
Advanced version

Get the advanced JetFormBuilder listener

Built for agencies and brands that run paid ads. Every lead carries the data that Meta, Google Ads, TikTok and GA4 need to match the person and credit the right campaign.

Data it collects

  • Lead email, first name, last name and phone, plain and SHA-256 hashed, read from the form's fields by type, name and label
  • Address parts (city, state, zip, country), hashed too, and company from a field labelled company or business
  • Form ID, submit type (AJAX or page reload), confirmation type (message or redirect) and the redirect page
  • Post ID created by an Insert Post action, when the form has one (AJAX forms)
  • Page reload and redirect forms still send the full event: it waits in the tab and goes out on the result page, only when the server said success
  • Honeypot fields, system fields, CSRF token, CAPTCHA and fields hidden by conditions are never read
  • Field labels in the form, never the typed answers
  • Traffic source, medium and campaign from UTM values, click IDs or the referrer
  • 17 ad click IDs: gclid, gbraid, wbraid, dclid, fbclid, ttclid, msclkid, li_fat_id and more
  • First-party cookies: _ga, _gid, _gcl_au, _fbp, _fbc, _uetsid, _uetvid and _ttp
  • Visitor IP, country, region, city and postal code, with two backup providers
  • A unique event_id so Pixel and Conversions API leads count once
  • Consent switch: click IDs, IP and location are only collected after consent

What it fixes

  • Higher Meta Event Match Quality. More matching keys (hashed email, phone, fbp, fbc, IP and browser) on every Lead event.
  • More Enhanced Conversions matches. Google Ads gets hashed user data with each conversion, not just a count.
  • Correct attribution. UTM values and click IDs are saved with each lead, so you know which ad and keyword brought it.
  • Server-side ready. One clean event with an event_id that works with Meta CAPI, TikTok Events API and server-side GTM.
Pricing

Pick how you want it

One-time price. Start with the code, or let me set everything up for you.

$0
Free basic codeFires the event when the form is sent or the call is booked. Copy it from any listener page or from GitHub.
Get the free code →

Advanced code

You install it yourself

$89$100one-time
  • Advanced listener code, licensed to you
  • PDF setup guide: variables, triggers and tags
  • GTM import file: tag, trigger and variables in one go
  • Step-by-step setup video in your client portal
  • Free updates when the platform changes
Most popular

Code + setup call

We set it up together

$179$200one-time
  • Everything in Advanced code
  • 30-minute setup help on WhatsApp or a booked call
  • I check your GTM Preview and fix what does not fire
  • GA4, Google Ads and Meta tags explained step by step

Done for you: GA4 + Google Ads

I install and test it

$299$350one-time
  • Everything in Advanced code
  • I install the listener in your GTM
  • GA4 key event with the lead or booking details
  • Google Ads conversion with Enhanced Conversions
  • Tested in GTM Preview, GA4 DebugView and Google Ads

Done for you: full server-side

Browser + server tracking

$449$500one-time
  • Everything in GA4 + Google Ads
  • Meta Pixel + Meta Conversions API with event_id deduplication
  • Server-side GTM on Stape.io
  • Consent Mode v2 check
  • Tested in Meta Test Events and GA4 DebugView

Stape.io plan paid separately

Need a different kind of tracking?The packages above are for GTM event listeners. I also set up ChatGPT Ads conversions, Meta CAPI, TikTok Events API, Microsoft and LinkedIn Ads, offline CRM conversions (HubSpot, GoHighLevel, Salesforce), Shopify and WooCommerce server-side tracking, and Looker Studio reports.

Server-side: Server-side tracking runs on Stape.io. The Stape plan is not included: you pay Stape directly (they have a free plan for small sites). I set it up on your account. Get Stape (global) · Stape EU server

One-time prices in USD. You pay me directly and get an invoice in your client portal.

Not sure which one fits? Message me and I will tell you what you need.

Already bought the advanced code? Get it in your client portal.

FAQ

JetFormBuilder listener: common questions

My JetFormBuilder AJAX forms send no event. Why?

Older scripts wait for a request URL with ?jet_form_builder_submit=submit. New JetFormBuilder versions use a random key in that URL on every site, so the match never happens. This code uses JetFormBuilder's own success event instead.

Does it work with page reload forms and the Redirect to Page action?

Yes. The submit is remembered only when the form really posts, and the event goes out on the page JetFormBuilder sends the visitor to, only when the result is success. GTM must load on that page.

What can't it track?

A form that redirects to another domain: the result page is on a different site, so the page reload event can't be finished there. AJAX forms with a redirect still send the free event before they leave.

How do I get the advanced version?

Message me on WhatsApp. After payment I add it to your client portal with the code, a setup video, a PDF guide and a GTM import file.

Is the JetFormBuilder listener code really free?

Yes. The basic code on this page is free to copy and use on your own or your clients’ sites. It fires the jet_form_submit event when the JetFormBuilder form is sent.

What is the difference between the basic and advanced version?

The basic version only tells GTM that a lead happened. The advanced version also sends UTM values, ad click IDs, hashed email and phone, first-party cookies, device and location data and an event_id, so Meta CAPI, Google Ads Enhanced Conversions and GA4 get much better data.

How do I get the advanced version?

Message me on WhatsApp, book a call or use the contact form. It is a paid, one-time purchase, and I can install it for you if you like.

Do I need to change my form?

No. The listener runs inside Google Tag Manager and listens for the form’s own success signal. You don’t need to edit the form or your theme.

🚀 Need Help With Advanced JetFormBuilder Tracking Setup?

💬 Want this implemented without mistakes?

I’ve completed 850+ projects for 600+ businesses and 15+ agencies, helping clients generate $11M+ in revenue with accurate client-side & server-side tracking and business automation.

⮏ My core services include:

⨭ GoHighLevel Automation — build CRM pipelines, WhatsApp automation, AI voice workflows & automated follow-ups end-to-end.
⨭ AI Agent Automation — deploy AI chatbots & agents for 24/7 lead qualification and support.
⨭ Paid Ads Management — Google Ads, Meta Ads.
⨭ Full Stack SEO/GEO/AEO Manager.
⨭ CRO-Focused Web Development — Landing Pages on WordPress, Shopify, Wix, Squarespace.
⨭ Google Tag Manager (GTM) — manage data layers & (Marketing platform Tag, Trigger & Variables).
⨭ Custom Code by GTM — HTML, CSS & JavaScript for advanced marketing platform tracking.
⨭ Server-Side Tracking — recover data lost to ITP & ad blockers (Official Stape Partner).
⨭ Google Analytics 4 (GA4) — visualize customer journeys.
⨭ Multi-Channel CAPI — Facebook, TikTok, Pinterest & Snapchat Conversion API & Klaviyo email marketing tools.
⨭ Third Party Checkout Conversion Tracking — Shopify, Stripe, GoKwik, Shiprocket, PayPal or more.
⨭ Google Consent Mode (GCM) — maintain GDPR compliance.
⨭ Marketing Automation — streamline workflows (Zapier/n8n/Make).
⨭ CRM Conversion Tracking — link offline sales to ads.
⨭ Tag Management — GTM & Third-Party Checkout Tracking.
⨭ Offline & CRM Tracking — HubSpot, Salesforce, Zoho, Pipedrive, Odoo, Webhook & Sheet.
⨭ Advanced Analytics — GA4, Google Looker Studio & BigQuery (SQL) for deep data visualization.

If you want your JetFormBuilder Tracking done right the first time, message me.