MISALIGNED_DATE_FOR_FILTER when using v9

155 views
Skip to first unread message

Azfar Haziq

unread,
Jan 26, 2022, 6:36:08 PM1/26/22
to Google Ads API and AdWords API Forum
Hello,

I trying to migrate my google ads from v8 to v9. 

I was using the same query on v8 
SELECT customer.id, campaign.id, campaign.name, ad_group.id, ad_group.name, ad_group_ad.ad.id, ad_group_ad.ad.name, ad_group_ad.ad.legacy_responsive_display_ad.marketing_image, ad_group_ad.ad.legacy_responsive_display_ad.long_headline, ad_group_ad.ad.legacy_responsive_display_ad.description, ad_group_ad.ad.responsive_display_ad.descriptions, ad_group_ad.ad.responsive_display_ad.headlines, ad_group_ad.ad.responsive_display_ad.logo_images, ad_group_ad.ad.responsive_display_ad.long_headline, ad_group_ad.ad.responsive_display_ad.marketing_images, ad_group_ad.ad.responsive_display_ad.square_logo_images, ad_group_ad.ad.responsive_display_ad.square_marketing_images, ad_group_ad.ad.image_ad.image_url, ad_group_ad.ad.image_ad.name, segments.month, campaign.advertising_channel_type, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.conversions_value, metrics.cost_per_conversion, metrics.interactions, metrics.view_through_conversions FROM ad_group_ad WHERE segments.month BETWEEN '2021-12-01' AND '2021-12-31' AND campaign.advertising_channel_type IN ('DISPLAY') ORDER BY ad_group_ad.ad.id ASC

But now it throwing an error saying that the date format is wrong.
This is the error message I got from google itself

{"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"queryError":"MISALIGNED_DATE_FOR_FILTER"},"message":"Dates in conditions should be the start of week/month/quarter if the filtered field is segments.week/segments.month/segments.quarter.","trigger":{"stringValue":"segments.month"}}],"requestId":"QFppm0p9hnbz5z4exmHgBA"}]}}}

I already follow the format of YYYY-MM-DD even the query validator say my query is wrong when 2021-12-01 is already the first day of the month

Google Ads API Forum Advisor

unread,
Jan 27, 2022, 2:24:32 AM1/27/22
to ha...@corekara.co.jp, adwor...@googlegroups.com
Hello Azfar,

Thank you for reaching out to our team. 

To investigate the issue 'MISALIGNED_DATE_FOR_FILTER' error that you've mentioned and to address it, please provide us with the
complete request and response logs with request ID and request header generated on your end.

You may send the requested information via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Google Logo
Jinky Mandaya
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VPvfo:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 27, 2022, 5:39:58 AM1/27/22
to ha...@corekara.co.jp, adwor...@googlegroups.com
Hi Azfar,

Thank you for providing the requested details. I am also a member of the Google Ads API team and let me provide support to your concern.

Before proceeding to your concern, I would like to inform you first that I am going to delete your latest reply as it contains generated logs.

Moving forward, please note that this date '2021-12-31' should also be set as start of the week, with this, you need to set it as '2022-01-01' instead. Otherwise, you can use the segments.date instead if you still want this date range BETWEEN '2021-12-01' AND '2021-12-31'.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VPvfo:ref
Reply all
Reply to author
Forward
0 new messages