I am using ads API for getting the spends based on state names of USA.
The below query gives segments.geo_target_state will be returned as an ID instead of name How can I combine this query with SELECT geo_target_constant.name, geo_target_constant.canonical_name FROM geo_target_constant WHERE geo_target_constant.id = <<OBTAINED ID FROM THE BELOW QUERY>>
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 " }'Hi Darren,
Thanks for reaching out to the Google Ads API Forum.
You may need to perform a separate request for the geo_target_constant report after pulling segments.geo_target_state from geographic_view report in order to get the name of those states. There is no way to combine two GAQL together in Google Ads API.
Regards,
|
||||||