Google api: segments.date dosent bring data

33 views
Skip to first unread message

Enzo Patriarca

unread,
Sep 20, 2023, 9:41:05 AM9/20/23
to Google Ads API and AdWords API Forum
SELECT
campaign.status,
campaign_budget.amount_micros,
metrics.clicks,
metrics.impressions,
metrics.cost_micros,
metrics.conversions,
metrics.cost_per_conversion,
segments.date
FROM
campaign
WHERE
segments.date BETWEEN '$start' AND '$end'
ORDER BY campaign.id

this is my query when i add the where it dosent work but when my query goes
just till FROM campaign it works

Google Ads API Forum Advisor

unread,
Sep 21, 2023, 7:02:47 AM9/21/23
to enzo.pa...@joinads.me, adwor...@googlegroups.com
Hi Enzo,

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

By reviewing your concern, I understand that when you add the where clause to your query it doesn't work. Upon checking the query you have provided, I can see that '$start' AND '$end' are malformed operands. Filtering conditions on the "segments.date" field using the "BETWEEN" operator must contain an operand that takes the format of "[YYYY-MM-DD]" AND "[YYYY-MM-DD]".

That being said, I would suggest you check this guide to know about the date range and the rules for core date segment fields. I recommend you to use the Google Ads Query Builder and Query Validator tools for constructing queries.

 
This message is in relation to case "ref:_00D1U1174p._5004Q2oznKV:ref"

Thanks,
 
Google Logo Google Ads API Team


 

Reply all
Reply to author
Forward
0 new messages