Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Live chat leads not attributed: how to pass UTMs to chat

TRK-258Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

A visitor clicks an ad, lands on a page with utm_source, utm_campaign or a gclid (Google click ID) in the URL, and later opens your live chat. The chat tool creates a contact or lead, but it only knows what you gave it. If nobody passed the campaign data to the widget, the conversation has no source.

Why it costs you leads or sales

Chat leads are often high intent. If they show as direct or unknown, you cannot tell which campaigns produce them. Reports undervalue the channels that really drive chats, and you may cut budget from ads that work.

Where the campaign data is lost
  1. Ad clickURL has utm_source and gclid
  2. Landing pageParameters visible in the URL
  3. Chat openedWidget gets no campaign data
  4. Chat lead in CRMSource: direct or unknown
  5. Ad reportingChat conversion not credited

The UTMs exist on landing but never reach the chat lead.

Chat leads by recorded sourceExample numbers
Chat leads by recorded source (example)Before: unknown source: 44 leads; Before: known source: 6 leads; After: unknown source: 8 leads; After: known source: 42 leads01734446842Before: unknown sourceBefore: known sourceAfter: unknown sourceAfter: known sourceleads

Example: 50 chat leads in a month. Before the fix most show no source; after, they are tied to campaigns.

How to check if your site has it

Test a chat lead by hand
  1. Open a private window

    Visit your site with a test URL such as https://yoursite.com/?utm_source=test&utm_medium=cpc&utm_campaign=chat-check.

  2. Browse to another page

    Click at least one internal link so the URL loses its parameters, like a real visitor would.

  3. Start a chat and give an email

    Use a test email so you can find the lead afterwards.

  4. Open the lead in your chat tool and CRM

    Look for the source, campaign and click ID fields. If they are empty or say direct, the data is not being passed.

How to fix it

The pattern is the same everywhere: capture the parameters on landing, keep them for the session, then hand them to the chat widget. The exact method depends on your chat tool, so check its documentation for the term it uses (custom attributes, visitor properties, contact fields or hidden fields).

Pass campaign data to your chat tool
  1. Capture parameters on landing

    Read utm_source, utm_medium, utm_campaign, utm_term, utm_content and gclid from the URL and save them in first-party storage.

  2. Create matching fields

    In your chat tool and CRM, create custom fields for each value so there is somewhere to store them.

  3. Send them to the widget

    When the widget loads, set the stored values as visitor or contact attributes using your chat vendor's API.

  4. Map fields into the CRM

    Make sure the chat integration copies these fields onto the lead or contact record.

Capture UTMs and click ID on landingjavascript
(function () {
  var keys = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content','gclid'];
  var params = new URLSearchParams(window.location.search);
  var found = {};
  keys.forEach(function (k) {
    if (params.get(k)) found[k] = params.get(k);
  });
  if (Object.keys(found).length) {
    sessionStorage.setItem('campaign', JSON.stringify(found));
  }
})();

// Later, when your chat widget is ready, read it back:
function getCampaign() {
  try { return JSON.parse(sessionStorage.getItem('campaign')) || {}; }
  catch (e) { return {}; }
}
// Pass getCampaign() to your chat tool's attribute/identify call.
Where to add the capture script
  1. Add a Custom HTML tag

    Paste the capture script, trigger it on All Pages, and set it to fire before the chat tag using tag sequencing.

  2. Add a second tag for the chat call

    Call your chat vendor's attribute method with the stored values once the widget has loaded.

How to confirm it's fixed

Confirmation checks
  • A test chat started after landing on a UTM URL shows the source, medium and campaign on the chat contact.
  • The same values appear on the lead or contact in your CRM.
  • The values survive navigating to a second page before chatting.
  • The gclid is stored on the lead when the landing URL included one.
  • Chats started with no UTMs still work and show a sensible default such as direct.

How to prevent it happening again

Chat widgets get replaced, upgraded or moved into new tag containers, and attribute calls often get lost. Repeat the manual test after any change to the chat tool, consent banner, theme or tag setup.

Changes that commonly break chat attribution
ChangeWhat can go wrong
New chat vendor or widgetOld attribute call no longer exists
Consent banner updateCapture script blocked or runs too late
Theme or template changeScript removed from the head
CRM field renameMapped fields stop filling

How FunnelGuard handles this

FunnelGuard does not check this yet. Checking whether chat leads carry their campaign source is a possible future check, not a current feature.

What FunnelGuard does today is run your real customer journeys on a schedule, check each step and the tracking hits sent to ad and analytics platforms such as GA4, Google Ads and Meta, and confirm that test leads reach the inbox and CRM. That can show you if the page or tags around your chat are broken, but not whether a chat lead has its UTMs.

Questions people ask

Why are my live chat leads showing as direct?

The chat tool usually only knows the current page, and by the time someone chats the UTMs have often left the URL. Unless you stored the parameters and passed them to the widget, the lead is recorded with no source and reports call it direct or unknown.

How do I pass UTM parameters to a live chat widget?

Save the UTMs and click ID in first-party storage when the visitor lands, then set them as custom attributes using your chat vendor's API when the widget loads. Create matching fields in the chat tool and CRM so the values are stored on the lead.

Can I track live chat conversions in Google Ads?

Yes, if you store the gclid on the chat lead and later import the conversion, for example as an offline conversion. Without the click ID saved on the lead, there is nothing to match back to the ad click.

Why do UTMs disappear before the visitor opens chat?

UTMs live only in the landing URL. When the visitor clicks to another page, the new URL usually has no parameters, so anything reading the URL at chat time sees none. Storing them on landing solves this.

Do I need cookie consent to store UTMs for chat attribution?

That depends on your setup and local law, so follow your consent platform's rules and your legal advice. Test with consent accepted and declined so you know exactly what is stored in each case.

Does FunnelGuard check live chat attribution?

No, not yet. It is a possible future check. FunnelGuard currently checks journey steps, tracking hits and whether test leads reach the inbox and CRM, so you should test chat attribution manually.

How do I test that chat attribution works?

Open a private window on a URL with test UTMs, click to another page, start a chat with a test email, then check the chat contact and CRM record for source, campaign and click ID values.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.