Hi Chen,
I'm Kevin from the Google Ads API Team.
Since you're not querying for any metrics, I suggest you try this query "SELECT user_interest.name, ad_group_criterion.custom_affinity.custom_affinity, ad_group_criterion.display_name FROM ad_group_criterion WHERE ad_group.id = xxxxxxxxxxxx" to get the data based on your screenshot. I've tried this on my end and I was able to successfully get the same data as the UI.
Afterwards, you will need to send a separate API request in order to get the display name of the audience segment. You can refer to the following query for reference "SELECT detailed_demographic.name FROM detailed_demographic WHERE detailed_demographic.id = 'xxxxx'". The detailed_demographic.id is the ad_group_criterion.display_name from the first request.
If you encounter any issue or if you have any further clarification, just let me know the details and provide the complete request and response logs with request ID so I can further investigate. You may send these via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.
Regards,
|
||||||