Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 items missing item_id or item_name: how to find and fix it

TRK-084Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

GA4 ecommerce events such as view_item, add_to_cart, begin_checkout and purchase carry an items array. Each entry in that array describes one product. Google's documentation says each item must include either `item_id` or `item_name`. Sending both is best practice.

This issue means one or more items arrive with neither field. It usually happens when a data layer variable points at the wrong key, when a theme or plugin leaves a field blank, or when a custom script builds the item by hand and forgets one.

Broken item vs valid itemjavascript
// Broken: no item_id and no item_name
{ price: 49.00, quantity: 1 }

// Valid
{ item_id: "SKU-1042", item_name: "Trail Running Shoes", price: 49.00, quantity: 1 }

Why it costs you leads or sales

The sale itself still happens, so this is easy to miss. But the data you use to decide what to sell and advertise becomes unreliable.

What goes wrong in practice
  • Item-level reports (Items viewed, Items added to cart, Items purchased) show (not set) or leave products out.
  • You cannot tell which products drive revenue, so budget and stock decisions rest on guesses.
  • Product-based audiences and remarketing lists built on item data are incomplete.
  • Funnel analysis by product, such as view to cart to purchase, is broken.
  • Merchandising and ad feed decisions rely on numbers that do not add up to your store totals.
Revenue you can attribute to a named productExample numbers
Revenue you can attribute to a named product (example)Before fix: 55 %; After fix: 100 %0387755100Before fixAfter fix%

Example: share of purchase revenue that appears against a named product in GA4 item reports before and after the fix. Numbers are illustrative.

How to check if your site has it

Check for missing item_id or item_name
  1. Open GA4 DebugView

    In GA4 go to Admin > DebugView. Turn on debug mode with Google Tag Assistant or the GA debug extension, then walk through a product page, add to cart and checkout.

  2. Inspect the items parameter

    Click each ecommerce event in DebugView and expand items. Every item should show item_id or item_name.

  3. Check the data layer

    In your browser console type dataLayer.filter(e => e.ecommerce) and look at each items array for blank or missing keys.

  4. Look at the reports

    In GA4 open Reports > Monetization > Ecommerce purchases. A large (not set) row under Item name or Item ID points to the problem.

  5. Test every item type

    Try variants, bundles, gift cards and discounted products. These often use a different template that omits the fields.

Console check: find items with no ID and no namejavascript
dataLayer
  .filter(e => e.ecommerce && e.ecommerce.items)
  .forEach(e => e.ecommerce.items.forEach((i, n) => {
    if (!i.item_id && !i.item_name) {
      console.warn('Bad item', e.event, n, i);
    }
  }));

How to fix it

The fix is the same everywhere: make sure each item gets a stable product ID (SKU or product ID) and a readable product name. The place you do it depends on your platform.

Add item_id and item_name by platform
  1. Check your GA4 plugin settings

    If you use WooCommerce with a GA4 plugin, open its ecommerce settings and check the product identifier option (ID or SKU). Update the plugin, as older versions can send incomplete items.

  2. Check products have SKUs

    If the plugin is set to use SKU, products with an empty SKU field can send a blank item_id. Fill in the SKU or switch the identifier to product ID.

  3. Review custom code

    If your theme or a snippet builds the data layer, make sure it outputs both item_id and item_name for each product.

Helper that always sets item_id and item_namejavascript
function toGa4Item(p, qty) {
  return {
    item_id: String(p.sku || p.id),
    item_name: p.name || p.title || String(p.sku || p.id),
    price: Number(p.price),
    quantity: qty || 1
  };
}

window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 49.00,
    items: [toGa4Item(product, 1)]
  }
});
Items in a purchase event

Before

  • items contain only price and quantity
  • Item reports show (not set)
  • Top products cannot be identified

After

  • Every item has item_id and item_name
  • Item reports list real products
  • Product revenue matches your store

How to confirm it's fixed

Verify the fix
  1. Run a fresh test journey

    Visit a product, add it to the cart, start checkout and, where possible, use your store's test mode to complete an order.

  2. Check DebugView

    Expand items in each ecommerce event and confirm item_id and item_name are filled in.

  3. Test variants and bundles

    Repeat with a variable product, a bundle and a discounted product.

  4. Wait for reports

    Standard reports can take 24 to 48 hours to update. New purchases should show named items, though older data stays as it was.

How to prevent it happening again

Prevention checklist
  • Build items in one shared function or template, not in several places.
  • Make SKU and product name required fields in your catalogue process.
  • Retest ecommerce events after theme, plugin or checkout changes.
  • Review GTM changes in Preview mode before you publish.
  • Check the (not set) row in item reports each month.
  • Run a scheduled test of the purchase journey so a regression is caught fast.

How FunnelGuard handles this

FunnelGuard detects this issue today. A robot visitor runs your real shopping journey on a schedule, from the EU or the US, and reads the GA4 hits your site sends. It applies parameter rules to the ecommerce events, including a check that each item has an item_id or item_name.

If an item is missing both, FunnelGuard re-checks from a second region, then sends one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked with utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent, and it stops before payment unless your store's test mode is set up.

The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month and include a 3-day free trial. A free read-only website audit is also available.

Questions people ask

Why does GA4 show (not set) for item name or item ID?

GA4 shows (not set) when events arrive without that item field. This happens when the items array has no item_id or item_name, or the data layer variable that feeds it is empty. Check the event in DebugView and fix the mapping.

Is item_id or item_name required in GA4?

Yes, but only one of them. Google's GA4 ecommerce documentation says each item must include either item_id or item_name. Sending both is recommended so reports and audiences work well.

What happens if an item has neither item_id nor item_name?

GA4 cannot use that item, so it can be left out of item-based reports or appear as (not set). The purchase event and its total value may still be recorded, which is why the problem is easy to miss.

How do I check my GA4 items array?

Open Admin > DebugView, turn on debug mode and trigger an ecommerce event. Click the event and expand items to see each item's fields. You can also inspect dataLayer in the browser console.

Should item_id be the SKU or the product ID?

Either works, as long as you use the same one in every event and in your ad feed. Mixing them splits one product into two rows in reports.

Will fixing item_id change my past GA4 data?

No. GA4 does not rewrite past events, so older purchases keep their (not set) values. New events will show the correct items once the fix is live.

Can FunnelGuard tell me when items lose their item_id?

Yes. FunnelGuard runs your shopping journey on a schedule and applies parameter rules to the GA4 ecommerce events it sees, including whether items have an item_id or item_name. If they do not, you get an alert with a screenshot and a likely cause.

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.