DEV Community

Cover image for Track GoHighLevel Lead Forms in GA4 with Google Tag Manager
MD Niamul
MD Niamul

Posted on

Track GoHighLevel Lead Forms in GA4 with Google Tag Manager

If your GoHighLevel form sits on your website and GA4 shows no leads, the form is not broken. GA4 just cannot see it.

To track GoHighLevel lead forms in GA4 with Google Tag Manager, add a small listener that catches the message the form sends on submit, push it into the data layer as ghl_form_submit, and fire a GA4 generate_lead event from it. Mark generate_lead as a key event and your leads start showing in reports.

This matters because every decision you make later, from channel reports to ad bidding, is built on the lead count. A wrong count means wrong decisions. I fix this setup for agencies all the time as a GoHighLevel tracking specialist. Below is the five-step version of the fix, built in a real GTM container.

Step 1: See why GA4 misses your GoHighLevel form leads

Most GoHighLevel forms are added to a page as an iframe. Think of an iframe as a glass window in a brick wall. Your page is the wall, and the form is a separate room behind the glass. Google Tag Manager lives on the wall, so it can see the window but not what is typed inside.

  • Browsers block your page from reading a form that loads from another domain. This is the same-origin rule.
  • That is why the normal GTM form submission trigger stays silent for these forms.
  • A thank-you page can still count a lead, but it carries no form details and breaks when the form shows a message instead of redirecting.

The good news is that the form does send a message out through the glass when someone submits. Your page can listen for it. That is the way in, and Step 2 builds it.

Do this:

  • Open your landing page and check how the form is added: an iframe embed or a link to a hosted page.
  • Submit one test lead and note it in GoHighLevel.
  • Open GA4 Realtime and confirm that nothing arrives. That gap is your starting point.

Step 2: Add a listener in Google Tag Manager to catch the form submit

The listener is a short Custom HTML tag. It waits for the message the form sends, and when one arrives it pushes an event called ghl_form_submit into the data layer, together with the form ID and the message type.

I name the tag clearly, chtml GoHighLevel Iframe Listener, and fire it on Initialization, All Pages, so it is ready before the form loads. The code in my screenshot is a short version to show the idea. GoHighLevel changes its message format from time to time, so log one real message in your browser console and match the field names before you trust it. My free tool for building a form listener can write a starting version for you.

Do this:

  • In GTM, go to Tags, then New, and choose Custom HTML.
  • Paste the listener code and name the tag chtml GoHighLevel Iframe Listener.
  • Set the trigger to Initialization, All Pages.
  • Save, then keep the container in Preview mode for the next steps.

Step 3: Create the data layer variables and the custom event trigger

Now GTM needs to read what the listener pushed. Create one Data Layer Variable for each key. In my build they are dlv ghl.form_id, which reads ghl_form_id, and dlv ghl.event_type, which reads ghl_event_type. Keep the names flat and boring, because nested keys are where most mapping mistakes hide.

Then create a Custom Event trigger with the event name ghl_form_submit. This trigger is the moment a real lead happens, so every lead tag in your container can use it. If you are not sure how your data layer should look, build it with my free dataLayer code generator.

Do this:

  • Go to Variables, then New, and choose Data Layer Variable. Enter ghl_form_id as the name.
  • Repeat for ghl_event_type.
  • Go to Triggers, then New, and choose Custom Event.
  • Type ghl_form_submit as the event name and name the trigger ce ghl_form_submit.

Step 4: Send a GA4 generate_lead event and mark it as a key event

Create a GA4 Event tag. Pick your existing Google tag or Measurement ID, type generate_lead as the event name, and fire it on the ce ghl_form_submit trigger. I use generate_lead because it is a standard GA4 event name that reports and Google Ads already understand.

You can add the form ID as an event parameter too, so you can see which form brought which lead. After the first test lead appears in GA4, go to Admin, then Events, and mark generate_lead as a key event. Only then does GA4 count it as a conversion. If you want a second pair of eyes on the setup, here is my done-for-you GoHighLevel tracking setup.

Do this:

  • Create a new tag and choose Google Analytics: GA4 Event.
  • Enter your Measurement ID or pick the Google tag variable.
  • Set the event name to generate_lead.
  • Choose the ce ghl_form_submit trigger and save.
  • In GA4, mark generate_lead as a key event after the first lead arrives.

Step 5: Test the lead, handle consent and add server-side if you need it

Open Preview mode, load your page and submit a real test lead. Check three things: the ghl_form_submit event shows in the left panel, the GA4 tag fires on it, and the event appears in GA4 DebugView. My free tool to check GA4 events helps you check what reaches GA4. Only then click Submit and publish.

Two things to plan for. First, consent: if your visitors need to give consent, pass the consent signals with Google Consent Mode v2 so GA4 tags fire only when allowed. You can test your banner with my Consent Mode checker. Second, ad blockers and Safari can still drop browser requests. A server-side container on Stape sends the same event from your own subdomain, which keeps more of your real leads. That is an upgrade, and the web setup works on its own. If you also send these leads to Google Ads, read my GoHighLevel enhanced conversions guide.

Do this:

  • Run a test lead in Preview mode and confirm the event, the tag and DebugView.
  • Publish the container with a clear version name.
  • Check GA4 key events after a day.
  • Add Consent Mode v2 if you serve visitors who must give consent.
  • When the basics are stable, add the server-side route on Stape.

Quick answers

Why can't GTM track my GoHighLevel form with the normal form trigger?

Most GoHighLevel forms load in an iframe from another domain. Browsers stop your page from reading inside it, so the form submission trigger sees nothing. You need a message listener instead.

Which GA4 event should I use for a GoHighLevel lead?

Use generate_lead. It is a standard GA4 event name, and you can mark it as a key event so GA4 counts it as a conversion.

Do I need server-side tracking for GoHighLevel forms?

No. The web container setup works on its own. A server-side container on Stape adds resilience against ad blockers and Safari limits, but it is an upgrade.

Where do I check that the event reached GA4?

Use GTM Preview mode first, then GA4 DebugView and Realtime. After about a day, check that generate_lead shows in your key events.

Key takeaways

  • GoHighLevel forms usually live in an iframe, so GTM cannot read them with the normal form trigger.
  • A short Custom HTML listener catches the form's submit message and pushes ghl_form_submit into the data layer.
  • Data layer variables and one Custom Event trigger connect that event to any tag you want.
  • A GA4 generate_lead event, marked as a key event, turns the submit into a counted conversion.
  • Test in Preview mode and DebugView before you publish.
  • Add Consent Mode v2 where needed, and a server-side container on Stape if you want more resilience.

Summary

To track GoHighLevel lead forms in GA4 with Google Tag Manager, add a Custom HTML listener that catches the iframe form's submit message, push a ghl_form_submit event into the data layer, create data layer variables and a custom event trigger, and send a GA4 generate_lead event marked as a key event. This guide is for agencies and lead-gen businesses whose GoHighLevel leads do not show in GA4. Test in Preview mode and DebugView, add Consent Mode v2, and use optional server-side tracking on Stape for more accuracy.

Want the full written guide with the code? It is here: https://mdniamul.com/gohighlevel-form-conversion-tracking-services/

Do the leads in your GoHighLevel CRM match what GA4 shows right now?

MD Niamul

Conversion Tracking and Web Analytics Specialist, Digital Soldier Agency

Top comments (0)