25

While using GA4 view_cart, begin_checkout, add_payment_info events for Item array Price parameter is appending multiple zeros in GA debug view.

For example: we are sending price as below for items

gtag('event', "view_cart", {
   currency:'MXN',
   items:[
      {
         "item_id":"84162903",
         "item_name":"Multipack Magnum Mini Cl\u00e1sica 60ml",
         "quantity":14,
         "affiliation":"MI16",
         "discount":0,
         "item_brand":"Magnum",
         "item_category":"Multipack",
         "item_variant":"",
         "price":24040.8,
         "currency":"MXN",
         "coupon":null
      },
      {
         "item_id":"68199453",
         "item_name":"Pinta Magnum Almendras 440ML",
         "quantity":14,
         "affiliation":"MI16",
         "discount":0,
         "item_brand":"Magnum",
         "item_category":"Helado",
         "item_variant":"",
         **"price":9570.96**,
         "currency":"MXN",
         "coupon":null
      },
      {
         "item_id":"67536209",
         "item_name":"Magnum Double Caramelo 93ML",
         "quantity":14,
         "affiliation":"MI16",
         "discount":0,
         "item_brand":"Magnum",
         "item_category":"Paletas",
         "item_variant":"",
         "price":7654.5,
         "currency":"MXN",
         "coupon":null
      },
      {
         "item_id":"209045",
         "item_name":"Magnum Mini Almendras Multipack",
         "quantity":14,
         "affiliation":"MI16",
         "discount":0,
         "item_brand":"Magnum",
         "item_category":"Paletas",
         "item_variant":"",
         "price":7295.4,
         "currency":"MXN",
         "coupon":null
      }
   ],
   value:48311.66,
   cartQty:56
})

and appears as price: 9570960000. Even for non-decimal numbers the 0 are appended.

Expected: 9570.96

This gives wrong value. How to make this correct?

enter image description here

oguz ismail
  • 1
  • 16
  • 47
  • 69
Mohan
  • 451
  • 5
  • 6
  • 25
    I believe internally the value is multiplied by 1000000 so it can be stored as an integer (saves space) and the debug tool has forgotten to convert it back. Real reports seem to get it right. – Tony McCreath Apr 23 '21 at 22:10
  • 1
    I lost a few hours of my life trying to work this one out. I had the exact same problem. My reports do show the correct pricing. Hope the GA4 devs fix this one. – Lee A Mar 16 '23 at 23:36

1 Answers1

18

Per comment by Tony McCreath:

This is a non-issue in real reports and only appears in DebugView.

Internally the value is multiplied by 1000000 so it can be stored as an integer to save space. The debug tool fails to convert it back, but real reports seem to get it right.

Scott Gigante
  • 1,450
  • 1
  • 17
  • 29