Issue with Google Ads Query for shopping_product Metrics – Date Segmentation Error

30 views
Skip to first unread message

Bipasha Roy

unread,
Jan 27, 2025, 4:18:02 AM1/27/25
to Google Ads API and AdWords API Forum
  The query below is showing as valid in the query builder, but when I attempt to run it, I receive the following error message:

SELECT
    shopping_product.title,
    metrics.cost_micros,
    metrics.conversions,
    metrics.clicks,
    metrics.conversions_from_interactions_rate,
    segments.month    
FROM
    shopping_product
WHERE
    segments.date BETWEEN '${adjustedStartDate}' AND '${adjustedEndDate}'
ORDER BY
    metrics.cost_micros DESC
LIMIT 1000;

  Failed to fetch Google Ads product metrics: Rg { errors: [ { error_code: [Object], message: 'Date segmentation is not supported for shopping_product. Date segments can be used only for filtering.' } ], '@type': 'type.googleapis.com/google.ads.googleads.v17.errors.GoogleAdsFailure', request_id: 'zYtDCrbajUOjNg1SUbv2Xg' }  

  Could you please advise on how I can modify the query to get product data segmented by month or suggest an alternative approach to achieve this?  
  

Google Ads API Forum Advisor

unread,
Jan 27, 2025, 9:14:25 AM1/27/25
to roybip...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Note that segmentation by date segments is not permitted and will return UNSUPPORTED_DATE_SEGMENTATION error. On the other hand, filtering on date segments is allowed. I would suggest you to refer to the 'Product metrics, filtered by date (Account level)' documentation for more information. You can use the below query:
{
  "query": "SELECT shopping_product.title, metrics.cost_micros, metrics.conversions, metrics.clicks, metrics.conversions_from_interactions_rate FROM shopping_product WHERE segments.date BETWEEN '2024-08-01' AND '2025-01-27' ORDER BY metrics.cost_micros DESC LIMIT 1000"
}
 You can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API.
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGyaB:ref" (ADR-00285979)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Reply all
Reply to author
Forward
0 new messages