Hi,
Thank you for reaching out to the Google Ads API support team.
By reviewing your concern, I understand that you are facing issue in updating the end date in segments.date and you are looking for guidance to resolve this issue. Kindly note that filtering conditions on the "segments.date" field using the "<=" operator must contain an operand that takes the format of a date formatted as "YYYY-MM-DD". I would recommend you to kindly refer to the "
Google Ads Query Language Grammar" documentation for more information. Also, I would suggest you to refer to the "
Date Ranges" guide while querying with the date segments. You can also refer to the "
Predefined date range" where you cannot find the 'end_date' field which you are using in your API query. So I would request you to pass the custom date in place of "end_end" in your GAQL query. You can even include the "DURING" operator while segmenting with the date. Please find the sample GAQL query for your requirement:
SELECT campaign.name, metrics.cost_micros, metrics.clicks, metrics.impressions, metrics.ctr,
metrics.conversions, metrics.conversions_value FROM campaign WHERE segments.date >=
'2023-11-01' AND segments.date <= '2023-11-30'
or
SELECT campaign.name, metrics.cost_micros, metrics.clicks, metrics.impressions,
metrics.ctr, metrics.conversions, metrics.conversions_value FROM campaign WHERE segments.date
DURING LAST_30_DAYS
Additionally, I would suggest you to 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.!5004Q02rz6E2:ref"
Thanks,
 |
Google Ads API Team |
