Skip to content

Google Tag Manager

Set up a Leadux trigger in Google Tag Manager and use it to count chat leads as conversions in Google Ads, GA4 and Meta.

When the assistant wins a lead, the widget pushes a Leadux event into your website's data layer. In Google Tag Manager (GTM) you turn that event into a trigger, then attach the tags that report the conversion: Google Ads, and GA4 or Meta where the widget can't reach them itself. This page walks through the setup. For what the event contains and when it fires, see Conversion tracking.

Before you start

  • GTM must be installed on the pages where the widget runs. The widget only pushes to the data layer when GTM (or another tag that creates window.dataLayer) is on the page.
  • Check what already arrives without GTM. The widget also calls gtag.js and the Meta Pixel directly when they are on the page. Leave a test lead and look for Leadux in GA4 Reports → Realtime and in Meta Events Manager Test events. Only add GA4 or Meta tags below where nothing arrives, or each lead counts twice.

1. Create the trigger

  1. In GTM, open Triggers → New.
  2. Choose Custom Event as the trigger type.
  3. Set Event name to Leadux. It is case-sensitive: leadux doesn't match.
  4. Leave This trigger fires on at All Custom Events.
  5. Name it, for example "Leadux lead", and save.

For booking link clicks, create a second Custom Event trigger with the event name leadux_booking_click.

2. Create the variables

The event carries two values you can pass on to your tags. Create a Data Layer Variable for each under Variables → User-Defined Variables → New:

Data Layer Variable Name Suggested variable name What it holds
leadux_event_id DLV - leadux_event_id A unique ID for this lead
leadux_conversation_id DLV - leadux_conversation_id The conversation's ID in Leadux
leadux_booking_location DLV - leadux_booking_location The booking link's name (booking clicks only)

3. Add the Google Ads conversion tag

  1. In Google Ads, create a conversion action for website leads and choose to set it up with Google Tag Manager. Note the Conversion ID and Conversion Label.
  2. In GTM, open Tags → New and choose Google Ads Conversion Tracking.
  3. Enter the Conversion ID and Conversion Label.
  4. Optional: set Transaction ID to {{DLV - leadux_event_id}}. Google Ads then ignores a second conversion with the same ID.
  5. Under Triggering, choose your Leadux trigger and save.

Make sure your container also has a Conversion Linker tag firing on all pages, so Google Ads can match the lead to the ad click.

4. Add a GA4 event tag (only if needed)

Skip this step if Leadux already shows in GA4 Realtime after a test lead. That happens when your website loads the Google tag (gtag.js) directly, because the widget then sends the event to GA4 itself.

If it doesn't arrive:

  1. Open Tags → New and choose Google Analytics → Google Analytics: GA4 Event.
  2. Enter your Measurement ID (G-…).
  3. Set Event Name to Leadux.
  4. Optional: under Event Parameters, add leadux_event_id with the value {{DLV - leadux_event_id}}.
  5. Under Triggering, choose your Leadux trigger and save.

In GA4, mark Leadux as a key event under Admin → Events once it has arrived, so you can import it into Google Ads or report on it.

5. Meta Pixel (usually not needed)

When the Meta Pixel is on the page, the widget sends Leadux to it directly with fbq('trackCustom', …), including when you load the pixel through GTM. Check Test events in Meta Events Manager first.

Only if the event doesn't arrive, for example because a GTM tag template loads the pixel without making fbq available to the page, add a tag of the same type you load the pixel with:

  1. Set it to send a custom event named Leadux.
  2. Set its event ID to {{DLV - leadux_event_id}}.
  3. Under Triggering, choose your Leadux trigger and save.

Passing the event ID lets Meta merge this event with the one from server-side conversions, if you use them.

6. Test with Preview

  1. In GTM, click Preview and enter your website's address. Your website opens with Tag Assistant connected.
  2. Open the chat and leave a test lead: give a name and a test email address or phone number.
  3. In Tag Assistant, a Leadux event appears in the list on the left. Select it and check that your tags are under Tags Fired.
  4. Under Variables, check that DLV - leadux_event_id has a value.

The event fires once per browser session. To test again, close the tab and open your website in a new one. Delete test leads in Leadux when you are done.

7. Publish

Click Submit in GTM, describe the version (for example "Leadux conversion tracking") and Publish. Tags don't run for your visitors until you publish.

Last updated . Questions? Write to support@leadux.com.