How to get Audience segments information?

758 views
Skip to first unread message

Chen Xiaowei

unread,
Jan 12, 2022, 3:51:04 AM1/12/22
to Google Ads API and AdWords API Forum
Hi team, I want to get Audience segments like UI shows. I use  SELECT ad_group_audience_view.resource_name FROM ad_group_audience_view
SELECT campaign_audience_view.resource_name FROM  campaign  _audience_view
and API returns  their resource_name which are only an id like customers/XXXXXX/adGroupAudienceViews/133416813831~326804463039. How can I get more detailed information including audience segment name, type,targeting setting and status. Thanks,Vivi
audience segment.png

Chen Xiaowei

unread,
Jan 13, 2022, 7:46:49 AM1/13/22
to Google Ads API and AdWords API Forum
When I add user_list segment, it return null.

Google Ads API Forum Advisor

unread,
Jan 13, 2022, 11:51:58 AM1/13/22
to viviana...@gmail.com, adwor...@googlegroups.com

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,

Google Logo
Kevin Gil Soriano
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Uj7um:ref
Reply all
Reply to author
Forward
0 new messages