How to Fix the “Cart Data Needs Attention” Issue in Google Ads

When you see the yellow warning “Cart data needs attention” in your Google Ads conversion tracking diagnostics, it means your Purchase conversion event isn’t passing valid or complete product-level sales data — specifically, the items array required for Google Ads to understand which products were purchased.

Let’s go step-by-step to fix this in Google Tag Manager (GTM), using a GA4 ecommerce dataLayer as your source.

⚠️ What the “Cart Data Needs Attention” Warning Means

This diagnostic message typically appears in  Goals→ Conversions → Diagnostics → Cart data when:

  • The Google Ads Purchase tag is missing the items array.
  • The array exists but lacks one or more of these required keys:
    • id (product/item ID)
    • price
    • quantity
  • Your Merchant Center feed IDs don’t match the item_id values.
  • Or the data format is invalid (not an array of valid objects).

Step 1: Enable Product-Level Sales Data in the Purchase Tag

In Google Tag Manager → Google Ads Conversion Tracking (Purchase):

  1. Scroll down and check “Provide product-level sales data”.
  2. Set the Data Source to Custom Fields.
  3. You’ll see a field called Items — this is where we’ll insert the correct array.

If this field is left empty or malformed, your conversion will record — but Google Ads won’t know which items were sold, triggering the “Cart data needs attention” warning.

Step 2: Understand What the GA4 Items Array Looks Like

If you already use GA4 ecommerce tracking, your website likely pushes an items array into the dataLayer during a purchase event.

Here’s an example of what a GA4 items array looks like:

“items”: [

  {

    “item_id”: “SKU_12345”,

    “item_name”: “Cotton T-Shirt”,

    “price”: 19.99,

    “quantity”: 2

  },

  {

    “item_id”: “SKU_67890”,

    “item_name”: “Denim Jeans”,

    “price”: 49.99,

    “quantity”: 1

  }

]

This structure is perfect for GA4 but not automatically compatible with Google Ads — which expects a simplified version of this array.

Step 3: Convert the GA4 Items Array to the Google Ads Cart Items Format

Now we’ll create a Custom JavaScript Variable in GTM to map the GA4 format into what Google Ads expects.

Code:

function() {

  var items = {{dlv – items array}}; // GA4 items array from your dataLayer

  return items.map(function(item) {

    return {

      id: item.item_id.toString(),

      price: parseFloat(item.price),

      quantity: item.quantity ? parseFloat(item.quantity) : 1

    };

  });

}

🔍 What this code does:

  • Takes your GA4 items array.
  • Maps each product to a simplified object for Google Ads.
  • Ensures:
    • id → string
    • price → number
    • quantity → number (defaults to 1 if missing)

Step 4: The Final Output (Cart Items Array)

After running the above transformation, your final Cart Items array — which Google Ads receives — will look like this:

[

  {

    “id”: “SKU_12345”,

    “price”: 19.99,

    “quantity”: 2

  },

  {

    “id”: “SKU_67890”,

    “price”: 49.99,

    “quantity”: 1

  }

]

This is the correct structure Google Ads expects in the Items field when “Provide product-level sales data” is enabled.

Step 5: Assign the Variable in Your GTM Tag

  1. Go back to your Google Ads Purchase Conversion tag in GTM.
  2. In the Items field, select the new Custom JavaScript variable you created above.
  1. Save and publish your container.
  2. Test in Preview Mode:
    • Complete a purchase.
    • Check that the items array appears correctly in the conversion payload/debug view.
    • Ensure each item has id, price, and quantity.

Step 6: Verify in Google Ads Diagnostics

After a few conversions (usually 24–48 hours), check your Google Ads diagnostics:

Goals→ Conversions → Purchase → Diagnostics → Cart Data

If everything is correctly implemented, the warning “Cart data needs attention” will disappear — replaced with a green check and the message “Cart data is excellent.”