Hello, The query you provided relates to the search term categories, not the search terms. In order to get the search terms (denoted as a segment in the campaign_search_term_insight view) you require a further selection of a single search term insight ID as follows:
SELECT campaign_search_term_insight.campaign_id, campaign_search_term_insight.id, campaign_search_term_insight.category_label, campaign_search_term_insight.resource_name, segments.search_term, metrics.impressions, metrics.conversions, metrics.conversions_value FROM campaign_search_term_insight WHERE campaign_search_term_insight.campaign_id = 123456789 AND campaign_search_term_insight.id = 987654321 AND segments.date BETWEEN '2024-01-01' AND '2024-01-31' In order to get all serach terms for a single campaign, it is first necessary to extract all search term categories via the query you provided, and then iterate over those IDs to extract the individual search terms. Some PMax campaigns have more than 10,000 search categories, requiring thousands of calls to Google Ads for a single campaign. That is a real problem Moshik On Monday, May 6, 2024 at 1:39:56 PM UTC+3 Google Ads API Forum Advisor wrote: > Hi Moshik, > > Kindly note that it is not possible to retrieve all the search terms at > once from the Performance Max campaigns from the Google Ads API. However, > it is possible to retrieve the search terms data individually from each of > the Performance Max campaigns. If you try to retrieve the search terms data > for all the campaigns, it will result in a " > REQUIRES_FILTER_BY_SINGLE_RESOURCE > <https://developers.google.com/google-ads/api/reference/rpc/v16/SearchTermInsightErrorEnum.SearchTermInsightError#:~:text=REQUIRES_FILTER,a%20single%20resource.>" > error. > Please find the sample GAQL query for the same: > > > SELECT campaign_search_term_insight.campaign_id, > campaign_search_term_insight.category_label, campaign_search_term_insight.id, > metrics.clicks, > metrics.impressions, metrics.conversions, metrics.conversions_value FROM > campaign_search_term_insight WHERE segments.date BETWEEN '2024-04-20' AND > '2024-05-06' > AND campaign_search_term_insight.campaign_id = '***********'" > > Additionally, you can utilize the Google Ads Query Builder > <https://developers.google.com/google-ads/api/fields/v16/overview_query_builder> > > and Query Validator > <https://developers.google.com/google-ads/api/fields/v16/query_validator> > to build and validate the queries for retrieving the data from the Google > Ads API. > > This message is in relation to case > "ref:!00D1U01174p.!5004Q02rzHLQ:ref" (ADR-00224131) > > > Thanks, > > [image: Google Logo] Google Ads API Team > > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d9eeb563-e328-49f2-9713-64e757b4d711n%40googlegroups.com.
