Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 item price sent as a string or with a currency symbol: fix

TRK-085Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

GA4 ecommerce events (view_item, add_to_cart, begin_checkout, purchase) carry an items array. Each item has fields such as item_id, item_name, quantity and price. The price field must be a number. The currency goes in the event-level currency field as an ISO code like USD or EUR.

Wrong vs right item pricejavascript
// Wrong
items: [{ item_id: "SKU-1", item_name: "Mug", price: "$19.99", quantity: 1 }]
items: [{ item_id: "SKU-1", item_name: "Mug", price: "19,99", quantity: 1 }]

// Right
currency: "USD",
items: [{ item_id: "SKU-1", item_name: "Mug", price: 19.99, quantity: 1 }]

Why it costs you leads or sales

Where a bad price breaks the chain
  1. Product pagePrice shown as $19.99
  2. dataLayer pushprice: "$19.99" (text)
  3. GA4 eventPrice ignored or read as 0
  4. Revenue reportsItem revenue wrong
  5. Ad biddingLearns from wrong values

The sale happens, but the value is lost on the way to your reports and ad platforms.

Reported revenue vs real revenueExample numbers
Reported revenue vs real revenue (example)Real sales: 10,000 $; GA4 (all prices numeric): 10,000 $; GA4 (half sent as text): 5,000 $03,8337,66710,00010,0005,000Real salesGA4 (all prices numer…GA4 (half sent as tex…$

Example: a store with $10,000 of real sales in a week, where GA4 only counts items whose price was sent as a number.

How to check if your site has it

Inspect the real values
  1. Open GA4 DebugView

    In GA4 go to Admin > DebugView. Turn on debug mode with Google Tag Assistant or the GA debugger extension, then browse a product and add it to the cart.

  2. Open the event and its items

    Click add_to_cart or purchase, then expand the items parameter. Check that price is present and shown as a number.

  3. Check the dataLayer in the browser

    Open DevTools > Console and type dataLayer. Find the ecommerce push and look at price. Quotes around the value mean it is text.

  4. Compare with your reports

    In Reports > Monetisation > Ecommerce purchases, look for products with purchases but zero item revenue.

Console check for text pricesjavascript
dataLayer.filter(e => e.ecommerce && e.ecommerce.items).forEach(e => {
  e.ecommerce.items.forEach(i => console.log(e.event, i.item_id, typeof i.price, i.price));
});
// typeof must be "number"

How to fix it

Fix by platform
  1. Find the source

    Identify which plugin pushes ecommerce data (for example a WooCommerce GA4 plugin or your theme). Update it first, as many price bugs are fixed in newer versions.

  2. Check plugin settings

    Look for options about price format, tax display or tracking of displayed prices. Choose the option that sends raw product prices.

  3. Custom code

    If you push your own data, use (float) $product->get_price() in PHP instead of wc_price() or get_price_html(), which return formatted text.

Clean a price string into a numberjavascript
function toPrice(v) {
  if (typeof v === 'number') return v;
  var s = String(v).replace(/[^0-9.,-]/g, '');
  // 1.299,50 (comma decimal) vs 1,299.50 (dot decimal)
  if (/,\d{1,2}$/.test(s)) s = s.replace(/\./g, '').replace(',', '.');
  else s = s.replace(/,/g, '');
  var n = parseFloat(s);
  return isNaN(n) ? undefined : Math.round(n * 100) / 100;
}

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 19.99,
    items: [{ item_id: 'SKU-1', item_name: 'Mug', price: toPrice('$19.99'), quantity: 1 }]
  }
});
Item price in the dataLayer

Before

  • price: "$19.99"
  • Currency symbol inside the value
  • GA4 may ignore the price
  • Item revenue shows 0

After

  • price: 19.99
  • currency: "USD" sent separately
  • GA4 reads the value
  • Item revenue matches orders

How to confirm it's fixed

Verify the fix
  1. Retest in DebugView

    Run through view_item, add_to_cart and a test order. Each item should show price as a number.

  2. Run the console check

    The typeof check should print "number" for every item.

  3. Test other currencies and locales

    If your store supports more than one currency or language, test each, since comma decimals break most often there.

  4. Check reports after a day

    Standard GA4 reports can take 24 to 48 hours. Confirm products now show item revenue.

How to prevent it happening again

Prevention checklist
  • Read prices from raw data, never from displayed text
  • Send currency as a separate ISO code
  • Re-test ecommerce events after theme, plugin or checkout changes
  • Test each currency and language version of the store
  • Keep one documented place where the ecommerce dataLayer is built
  • Check DebugView after every release that touches product or cart templates

How FunnelGuard handles this

Questions people ask

Why is my GA4 item revenue showing 0?

A common cause is that item price is sent as text, such as "$19.99", instead of a number. Other causes are a missing price, quantity of 0, or an items array that is not sent. Check one event in DebugView and expand the items parameter.

Should GA4 price include the currency symbol?

No. Send price as a plain number like 19.99. Put the currency in the separate currency field as a three-letter code such as USD, EUR or GBP.

Can GA4 price be a string like "19.99"?

It is safer to send a number. Text in quotes can be handled inconsistently, and values with symbols or comma decimals are often dropped. Convert to a number before sending to avoid guesswork.

How do I convert a price string to a number in Google Tag Manager?

Create a Custom JavaScript variable that removes symbols, handles comma or dot decimals and returns a number with parseFloat. Use it for the price field and check it in Preview mode. Better still, fix the source so the dataLayer holds a raw number.

How do I check what price GA4 received?

Open Admin > DebugView, trigger the event with debug mode on, and expand the items parameter on the event. You can also type dataLayer in the browser console and inspect the ecommerce push.

Do I use a comma or a dot for decimals in GA4 prices?

Use a dot, as in 1299.50. Do not add thousands separators. Sending "1,299.50" or "1299,50" can cause the value to be misread or ignored.

Does this affect Google Ads conversion value?

It can. If the purchase value or the item prices are wrong, conversion values imported from GA4 or sent from the same data layer can be wrong too, which affects value-based bidding.

Can FunnelGuard detect a price sent as a string?

Only partly. FunnelGuard checks that your funnel steps and tracking hits work on a schedule, but it does not claim to validate the data type of each item price. Cover that by hand with DebugView and the console check.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

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.