Date ranges google ads api

10 views
Skip to first unread message

Joshua Rebel

unread,
Jul 3, 2024, 8:08:29 PM (3 days ago) Jul 3
to Google Ads API and AdWords API Forum
Hi,

How should i transform my date range if i want to compare the following data from query:

SELECT metrics.cost_micros, segments.week, campaign.name FROM campaign WHERE metrics.cost_micros > 0 AND segments.date DURING LAST_WEEK_MON_SUN

with the data of  two weeks ago (MON-SUN).

I can't find the proper date range to use this in my query.

Thanks in advance.

Joshua 

Google Ads API Forum Advisor

unread,
Jul 4, 2024, 7:53:18 AM (2 days ago) Jul 4
to j.r...@parkos.com, adwor...@googlegroups.com
Hi,

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

In order to get the data of two weeks ago, I would suggest using the LAST_14_DAYS in the segments.date or you can use the custom_date_range. Please refer to the sample query below: 
{
  "query": "SELECT metrics.cost_micros, segments.week, campaign.name FROM campaign WHERE metrics.cost_micros > 0 AND segments.date during LAST_14_DAYS"
  
}
You can try making a request using the Search or SearchStream. Also, you can use Query Builder to create your query and Query Validator to validate your query. For more information, I would suggest that you refer to the Date Ranges.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJaOZ:ref" (ADR-00245103)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJaOZ:ref" (ADR-00245103)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages