Booking Tools Free basic code Advanced version available

Breely GTM Event Listener

Free GTM listener for Breely booking forms. Tracks every booking step and the final submit as breely_form_step, ready for GA4, Google Ads and Meta.

Breely GTM Event Listener
Free code

Free Breely GTM listener code

Copy this into a Custom HTML tag in Google Tag Manager. It pushes breely_form_step to the dataLayer when someone books through Breely.

GTM Custom HTML · Breely
<script>
/* Breely listener by MD Niamul - mdniamul.com */
// Tracks Breely booking steps and submissions from an embedded Breely form.
// GTM: Custom HTML tag, trigger All Pages (or the pages with the Breely embed).
(function () {
  if (window.__mdnBreelyBasic) return;          // never add the listener twice
  window.__mdnBreelyBasic = true;
  window.dataLayer = window.dataLayer || [];

  var EXTRA_HOSTS = [];                         // custom Breely domain? add it, e.g. 'book.yoursite.com'
  var STEPS = {
    EventType: 'step_event_type',
    BookableResource: 'step_bookable_resource',
    Time: 'step_time',
    InitiateCheckout: 'step_initiate_checkout'
  };
  var recent = {};

  function fromBreely(origin) {
    var host = '';
    try { host = new URL(origin).hostname; } catch (e) { return false; }
    return host === 'breely.com' || /.breely.com$/.test(host) || EXTRA_HOSTS.indexOf(host) > -1;
  }

  window.addEventListener('message', function (event) {
    if (!fromBreely(event.origin)) return;
    var data = event.data;
    if (typeof data === 'string') {             // Breely sends a JSON string
      try { data = JSON.parse(data); } catch (e) { return; }
    }
    if (!data || typeof data !== 'object' || data.type !== 'tracking' || typeof data.eventName !== 'string') return;

    var name = data.eventName;
    var context = (data.context && typeof data.context === 'object') ? data.context : {};
    var step;
    if (name === 'breely_form_submitted') {
      step = 'form_submitted';
    } else if (name.indexOf('breely_form_step') === 0) {
      var part = name.slice(16);
      step = STEPS[part] || 'step_' + part.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
    } else {
      return;
    }

    // Skip the same message arriving twice (Breely can post to the parent and the top window).
    var key = step + '|' + (context.submission_unique_id || '');
    var now = Date.now();
    if (recent[key] && now - recent[key] < 3000) return;
    if (step === 'form_submitted' && context.submission_unique_id && recent[key]) return;
    recent[key] = now;

    window.dataLayer.push({
      event: 'breely_form_step',
      breely_step: step,
      form_name: context.eventtypename || '',
      page_path: window.location.pathname
    });
  });
})();
</script>

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

GTM triggerCustom EventEvent namebreely_form_step
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 breely_form_step, 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": "breely_form_step",
  "breely_step": "form_submitted",
  "form_name": "Discovery Call",
  "page_path": "/book/"
}
Step by step

How to set up the Breely listener in GTM

How to install the free Breely GTM listener

  1. Embed your Breely form on your own page with Breely’s code: Forms → your form → Share → Embed in Webpage (inline or popup). A share link that opens Breely in a new tab can’t be tracked.
  2. In Google Tag Manager, go to Tags → New → Custom HTML and paste the free code below.
  3. Set the trigger to All Pages, or only the pages with the Breely embed, and save.
  4. Create a Custom Event trigger with the event name breely_form_step. For conversions, add the condition Data Layer Variable breely_step equals form_submitted.
  5. Attach your GA4, Google Ads or Meta tags to that trigger.
  6. Open Preview, book a test slot, check that breely_form_step fires once with form_submitted, then publish.

Breely’s own embed script also pushes an event called breely_form_submitted. Use one of the two for your conversion tags, not both, or every booking counts twice.

Compare

Basic vs advanced Breely 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 Breely 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

  • Booking step funnel: event type, resource, time, checkout, submit
  • Breely event type name and form ID
  • Picked appointment start time
  • Staff or resource picked
  • Amount paid and currency
  • New client flag and upcoming appointment flag
  • Breely submission ID
  • Contact email, phone, first and last name
  • SHA-256 hashed email, phone, names, city, state, zip and country
  • UTM source, medium and campaign
  • Ad click IDs: gclid, gbraid, wbraid, fbclid, ttclid, msclkid and more
  • First-party marketing cookies: _ga, _fbp, _fbc, _ttp, _uetvid and more
  • IP address and location (3 providers, consent based)
  • Device, OS, browser language and screen size
  • Landing page, page URL and referrers
  • event_id for deduplication
  • client_id, session_id and external_id
  • Consent check before ad data is collected

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

Breely listener: common questions

Does this work with a Breely share link?

No. The booking has to happen on your page through Breely's embed code (inline or popup). A share link opens Breely in a new tab, so your GTM can't see it. For those, use Breely's thank-you page redirect.

Breely already pushes breely_form_submitted. Why use this?

This listener gives you one event for every step and the submit, safely parsed, with a clean step name you can filter on. Pick one of the two for conversions so bookings don't count twice.

Does the free code send personal data?

No. It only sends the step, the event type name and the page path. The advanced version hashes email, phone and names for Enhanced Conversions and Meta CAPI.

How do I get the advanced code?

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 Breely 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 breely_form_step event when the Breely 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 Breely Booking 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 Breely Booking Tracking done right the first time, message me.