Get Ad campaign reports based on country and state

122 views
Skip to first unread message

Darren D'Mello

unread,
Jun 8, 2022, 6:49:18 AM6/8/22
to Google Ads API and AdWords API Forum
I want to get the report as shown here https://prnt.sc/oG7ms7tOdVfH

The input is Country = USA
Date from and Date to

But this gives non US states and it doesnt summarize the resuly by state names

Can anyone help me to get the REST API?

curl "https://googleads.googleapis.com/v10/customers/${CUSTOMER_ID}/googleAds:searchStream" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data '{ "query": " SELECT campaign.name, segments.geo_target_state, metrics.cost_micros FROM geographic_view WHERE geographic_view.location_type = LOCATION_OF_PRESENCE AND segments.date BETWEEN 20220101 AND 20220430 " }'

Google Ads API Forum Advisor

unread,
Jun 8, 2022, 9:25:28 AM6/8/22
to miscellan...@gmail.com, adwor...@googlegroups.com

Hi Darren,

Thanks for reaching out to the Google Ads API Forum.

Since you mentioned that your GAQL gives you non US states, could you provide us customer ID so that I can impersonate on my end?

With regards to results does not summarize by state names, you may need to perform a separate request for the geo_target_constant report after pulling segments.geo_target_state from geographic_view report.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bdUx2:ref

Google Ads API Forum Advisor

unread,
Jun 8, 2022, 9:30:41 AM6/8/22
to adwor...@googlegroups.com, miscellan...@gmail.com

Hi Darren,

In addition to above, you may also share privately(for sensitive details) the API response where you are getting Non-US locations, so it will help in our investigation. 

Regards,

Darren D'Mello

unread,
Jun 8, 2022, 10:41:34 AM6/8/22
to ads...@forumsupport.google, adwor...@googlegroups.com
Sorry for my poor ability. I actually meant that it's giving me the non state names instead it gives me ids.

So if my report gives 200 rows I need to call geo_target_constant 200 times?

This is not a good approach I think. Could you help me whether the same can be achieved using location api?

https://prnt.sc/oG7ms7tOdVfH as shown like here

I wanted to get the spends daily for all states. Any help is greatly appreciated
Reply all
Reply to author
Forward
0 new messages