How to obtain human-readable names for all audience segments (criterion) through Google Ads API v20?

3 views
Skip to first unread message

Mark Ignacio

unread,
6:17 AM (3 hours ago) 6:17 AM
to Google Ads API and AdWords API Forum
Hi Google Ads API team,

Business need  
I’m building a reporting tool that lists metrics (impressions, clicks, conversions, cost, etc.) per audience segment.  
For every segment we must show the same friendly name the Google Ads UI displays.

Current workflow (API v20)

1.  Metrics per audience criterion

    ```gaql
    SELECT
      ad_group_criterion.criterion_id,
      metrics.impressions,
      metrics.clicks,
      metrics.conversions,
      metrics.cost_micros
    FROM ad_group_audience_view
    WHERE campaign.id = <CAMPAIGN_ID>
      AND segments.date BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD'
    ```

2.  Attempt to map each `criterion_id` to a label

    ```gaql
    SELECT
      ad_group_criterion.criterion_id,
      ad_group_criterion.user_list.user_list,
      ad_group_criterion.display_name
    FROM ad_group_criterion
    WHERE campaign.id = <CAMPAIGN_ID>
      AND ad_group_criterion.type = AUDIENCE
    ```

3.  Translate numeric topic IDs (placeholders like “Audience #123 …”)

    ```gaql
    SELECT
      vertical_constant.resource_name,
      vertical_constant.name
    FROM vertical_constant
    WHERE vertical_constant.resource_name IN ('verticalConstants/123', ...)
    ```

Processing logic  
• use `display_name` when it’s non-empty  
• look up user lists by resource name to get their `.name`  
• replace “Audience #<n>” with the returned `vertical_constant.name`  
• tidy Google’s auto-generated strings `AdGroupPersona_<hash>_<ts>`

Problem  
After all steps many criteria still show only “Audience #<ID>”.  
Those same criteria display a friendly name in the Google Ads UI.

What we tried (and failed)  
• Adding `ad_group_criterion.user_interest`, `.custom_audience`, `.combined_audience` to SELECT → GAQL error: “field may not be used in SELECT clause”.  
• Querying `user_interest`, `custom_audience`, `combined_audience` tables directly – we have only numeric `criterion_id`, no resource names.  
• Granting “Audience Manager” UI permissions is not possible for every customer.

Questions

1. Is there any supported way to convert **every** audience `criterion_id` to the same human-readable label the UI shows, especially when `display_name` is just “Audience #<ID>”?  
2. Do the orphan numeric IDs map to an internal taxonomy that isn’t exposed via `vertical_constant`? If yes, what fallback should we show?  
3. Are there other fields/services (GoogleAdsFieldService, etc.) that let us resolve names for user-interest, custom-audience, or combined-audience criteria programmatically?

Thanks for any guidance—our users need meaningful audience names and we’d like to avoid scraping or static mapping tables.

Thank you.
Reply all
Reply to author
Forward
0 new messages