Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Meta Pixel purchase value sent as string with comma decimals

TRK-173Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

The Meta Pixel is a script that reports actions on your site to Meta. On a purchase it sends a Purchase event with two key parameters: value (the order amount) and currency (a three-letter code such as EUR or USD).

This issue happens when value is not a clean number. Typical bad values are "49,90" (comma decimal, common in many European shops), "1,249.00" (thousands separator), "€49.90" (symbol) or "49.90 EUR". The same problem can appear in server events sent through the Conversions API (CAPI), where custom_data.value should also be numeric.

Bad vs good Purchase calljavascript
// Bad: formatted strings
fbq('track', 'Purchase', { value: '49,90', currency: 'EUR' });
fbq('track', 'Purchase', { value: '€1,249.00', currency: 'EUR' });

// Good: a number, dot decimal, no separators
fbq('track', 'Purchase', { value: 49.90, currency: 'EUR' });

Why it costs you leads or sales

Meta uses purchase value to report ROAS (return on ad spend) and to optimise for value. If the value is misread or missing, your reports show the wrong revenue and the algorithm learns from bad data. A value of "49,90" may be read as 49 or 4990, or be ignored, depending on how it is parsed. You cannot rely on the result, so treat any non-numeric value as a bug.

Reported revenue for the same 10 ordersExample numbers
Reported revenue for the same 10 orders (example)Actual in shop: 500 EUR; Misread low: 450 EUR; Value dropped: 0 EUR; Misread high: 50,000 EUR019,16738,333500450050,000Actual in shopMisread lowValue droppedMisread highEUR

Example: ten orders worth 500 EUR in total. A comma string can be misread low or high, so Meta shows a different number from your shop.

Where the value goes wrong
  1. Customer paysOrder total 49,90 shown on page
  2. Data layer / scriptValue read as formatted text
  3. Pixel / CAPI eventvalue: "49,90"
  4. Meta reportsWrong or missing revenue and ROAS

The order is fine; the break happens when the amount is formatted for display and passed on as text.

How to check if your site has it

Check the value Meta receives
  1. Open Meta Pixel Helper

    Install the Meta Pixel Helper browser extension, place a test order (or use your store's test mode), and open the helper on the thank-you page.

  2. Inspect the Purchase event

    Click the Purchase event and read the custom parameters. Look at value: it should be a number like 49.9 with no quotes, comma or symbol. Check currency is present too.

  3. Check the Network tab

    In browser DevTools, open Network, filter for facebook.com/tr, and find the request with ev=Purchase. The cd[value] parameter shows what was sent. A value like 49%2C90 means a comma was sent.

  4. Review Events Manager

    In Meta Events Manager, open your Pixel, then Test Events or the Purchase event details. Compare the value Meta shows with your order total.

  5. Check server events

    If you use the Conversions API, inspect the payload your server sends and confirm custom_data.value is a number, not a string.

How to fix it

The rule is the same everywhere: take the raw order total (not the formatted display text), convert it to a number, and pass it with a dot as the decimal separator and no thousands separator. How you do that depends on your platform.

Fix by platform
  1. Find where the Pixel is added

    Check your Meta/Facebook plugin, a tag plugin or theme code. Many WooCommerce setups send $order->get_total(), which is already a plain number; formatted output from wc_price() is not.

  2. Use the raw total

    In custom code, use (float) $order->get_total() and print it with number_format($total, 2, '.', ''). Never echo wc_price() into the event.

  3. Check the currency

    Pass get_woocommerce_currency() as currency.

Convert a formatted price to a numberjavascript
function toNumber(input) {
  if (typeof input === 'number') return input;
  var s = String(input).replace(/[^0-9,.\-]/g, '');
  var lastComma = s.lastIndexOf(',');
  var lastDot = s.lastIndexOf('.');
  if (lastComma > lastDot) {
    // comma is the decimal separator: 1.249,90 or 49,90
    s = s.replace(/\./g, '').replace(',', '.');
  } else {
    // dot is the decimal separator: 1,249.90
    s = s.replace(/,/g, '');
  }
  var n = parseFloat(s);
  return isNaN(n) ? 0 : Math.round(n * 100) / 100;
}

fbq('track', 'Purchase', {
  value: toNumber('49,90'),
  currency: 'EUR'
});

How to confirm it's fixed

Confirmation checklist
  • Place a new test order and open Meta Pixel Helper on the thank-you page.
  • The Purchase event shows value as a number with no quotes, comma or symbol.
  • currency is a valid three-letter code and matches the order.
  • The cd[value] in the Network request equals the order total.
  • Events Manager shows the same amount as your shop after a few minutes.
  • If you use CAPI, the server event shows the same numeric value.
Purchase event before and after

Before

  • value: "49,90" (string with comma)
  • Revenue misread or ignored in Meta
  • ROAS and value bidding unreliable

After

  • value: 49.9 (number)
  • currency: EUR
  • Revenue in Meta matches the shop

How to prevent it happening again

Prevention habits
  • Pass money as numbers in the data layer and backend; format only for display.
  • Never read prices from visible page text for tracking.
  • Retest Purchase after theme, checkout, plugin or language/locale changes, since locale often switches decimal style.
  • Test one order in a comma-decimal locale and one in a dot-decimal locale.
  • Review Events Manager value after each release.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A robot visitor runs your real customer journey on a schedule, and checks the tracking hits sent to Meta. This tells you whether a Purchase hit is sent at the expected step. FunnelGuard stops before payment unless your store's test mode is set up, so it cannot see the real value of a paid order.

Questions people ask

Why is my Meta Pixel purchase value wrong?

The most common cause is that value is sent as a formatted string such as "49,90" or "€49.90" instead of a plain number. Other causes are a missing currency, a duplicate Pixel, or tax and shipping being added differently from your shop. Check the Purchase event in Meta Pixel Helper and compare it with the order total.

Does Meta Pixel accept a comma as a decimal separator?

No, you should not rely on it. Meta expects a number with a dot as the decimal separator, such as 49.90. A comma string can be misread or ignored, so convert the value before sending.

How do I send the purchase value as a number in fbq?

Pass a number, not text: fbq('track', 'Purchase', {value: 49.90, currency: 'EUR'});. If your value comes as a string, convert it first with parseFloat after removing symbols and thousands separators.

How do I check what purchase value Meta received?

Use the Meta Pixel Helper extension on the thank-you page and open the Purchase event. You can also check the cd[value] parameter in the Network tab for the facebook.com/tr request, then compare Events Manager with your shop.

Does the value format matter for Conversions API too?

Yes. In server events, custom_data.value should be a number and currency a three-letter code. A string with a comma can cause the same wrong or missing revenue as with the browser Pixel.

Why does my Meta ROAS show zero or too high?

If the purchase value is dropped, revenue shows as zero. If a comma or thousands separator is misread, it can show far too high or low. Check the value format first, then check for missing currency or duplicate events.

Can FunnelGuard detect a comma in my Purchase value?

Only partly. FunnelGuard checks that the Meta tracking hit fires in your journey, but it stops before payment unless test mode is set up, so you should still check the value yourself in Pixel Helper after a test order.

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.