Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 parameter value undefined, null or (not set): fix it

TRK-050Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Every GA4 event can carry parameters, which are extra details such as form_id, method, value or item_name. This issue happens when the event is sent, but one parameter has no usable value. It then arrives as the text undefined, the text null, an empty string, or it is dropped and the report shows (not set).

What each symptom usually means
What you seeUsual cause
Literal text undefinedA JavaScript variable or object property did not exist when the code ran
Literal text nullA data layer value was explicitly set to null, or a lookup returned null
(not set) in a reportParameter missing, empty, or not registered as a custom dimension
Value is blank in GTM PreviewVariable name is misspelled or the data layer push happens after the tag fires

Why it costs you leads or sales

Where the value goes missing
  1. Visitor submits formReal action happens
  2. Tag reads variableVariable returns undefined
  3. GA4 receives eventParameter empty or 'undefined'
  4. Report shows (not set)No form, product or source detail

The event fires, but the parameter is empty, so reporting loses the detail.

Leads you can attribute to a formExample numbers
Leads you can attribute to a form (example)Before fix: 40 %; After fix: 98 %038754098Before fixAfter fix%

Example: share of 100 lead events where the form_id parameter holds a real value, before and after a fix.

How to check if your site has it

Find undefined, null and (not set) values
  1. Open GA4 DebugView

    In GA4 go to Admin > DebugView, then trigger the event on your site with GTM Preview mode or the GA debug extension active. Click the event and read each parameter value.

  2. Look for the words undefined or null

    Any parameter showing the literal text undefined or null, or missing from the list, is affected.

  3. Check GTM PreviewGoogle Tag Manager

    In Tag Assistant, click the event, open the GA4 tag and view its Values. Then open the Variables tab at that moment to see which variable is Undefined.

  4. Check the network request

    In browser DevTools open Network, filter by collect, and read the request payload. Parameters appear as ep.name for text and epn.name for numbers.

  5. Check reports

    In Reports or Explore, add the registered custom dimension and look for (not set) rows.

How to fix it

Fix by platform
  1. Match the variable name exactly

    Open the Data Layer Variable and compare its name with the key in the push. Keys are case sensitive, so formId and form_id are different.

  2. Fix the timing

    Make sure the dataLayer.push with the value runs before the event that triggers the tag. Use a Custom Event trigger on the push, not a click trigger that fires earlier.

  3. Set a default value

    In the variable settings, tick Set Default Value and enter a clear fallback such as unknown, so gaps are visible rather than blank.

  4. Remove empty parameters

    If a value does not apply to some pages, use a trigger condition so the tag only fires where the value exists.

Send only parameters that have a valuejavascript
function sendLead(params) {
  var clean = {};
  Object.keys(params).forEach(function (key) {
    var v = params[key];
    if (v !== undefined && v !== null && v !== '') {
      clean[key] = v;
    }
  });
  gtag('event', 'generate_lead', clean);
}

var form = document.querySelector('#contact-form');
sendLead({
  form_id: form ? form.id : 'unknown',
  method: 'contact_form'
});

How to confirm it's fixed

Confirmation checks
  • DebugView shows a real value for every parameter on the event
  • No parameter contains the text undefined or null
  • GTM Preview shows each variable with a value when the tag fires
  • The Network request to collect includes the expected ep. or epn. keys
  • After 24 to 48 hours, reports show far fewer (not set) rows for new data
  • Test on more than one page or form, not just one

How to prevent it happening again

Habits that stop it coming back
  • Keep a written list of each event and its parameters, with where each value comes from
  • Set default values on GTM variables
  • Re-test events after any form, theme, plugin or checkout change
  • Keep data layer key names consistent across developers and tools
  • Review GA4 reports for (not set) rows regularly
  • Run an automated check on your key journeys

How FunnelGuard handles this

Questions people ask

Why does my GA4 event parameter show undefined?

The tag or code read a variable that did not exist when the event fired. Common causes are a misspelled variable name, a data layer push that runs after the tag, or a property that is missing on that page. Check it in GTM Preview or GA4 DebugView.

Why is my GA4 custom dimension showing (not set)?

Either the event did not send the parameter with a value, or the parameter is not registered as a custom dimension. Check DebugView for the value first. If it is there, register it in Admin > Custom definitions; it only applies to data collected afterwards.

How do I fix undefined variables in Google Tag Manager?

Open GTM Preview, click the event and check the Variables tab to see which one is Undefined. Fix the name or timing, and set a default value in the variable. Then re-test in DebugView.

What is the difference between undefined, null and (not set) in GA4?

Undefined and null are values your code or tag sends as text when data is missing. (not set) is what GA4 reports show when a dimension has no value for an event. They all point to missing data, but the fix location differs.

Does an undefined parameter stop GA4 from counting the event?

No. The event is usually still counted. Only the detail attached to it is lost, which is why the problem often goes unnoticed in conversion totals.

Can I fix (not set) values in old GA4 data?

No. GA4 does not let you edit past event data, so you can only fix new data going forward. Fix the source, then compare reports from the fix date.

How can I check GA4 parameters without opening DevTools?

Use GA4 DebugView with GTM Preview or the GA debug extension. It lists each event and its parameter values in real time. An automated journey monitor can also check them on a schedule.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: params rules.

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.