Dear Team,
Thank you for your previous detailed response regarding Campaign Feeds and Location Groups. However, I would like to kindly clarify my actual requirement, as I believe there may have been some misunderstanding: - I am *not looking to retrieve location groups already assigned* to campaigns. - I am trying to *fetch the list of available location groups* (the same way it appears in the UI under “Choose store locations” > “Use location groups”) *before* associating them with a new Performance Max campaign. - Essentially, I would like to *display all available location groups* in my application so users can select from them when creating a campaign. Could you please confirm: 1. Which API resource or method should be used to retrieve the list of available location groups? 2. Could you please provide an example GAQL query to retrieve all such available location groups? Thank you for your support and guidance. On Thursday, April 24, 2025 at 11:55:41 PM UTC+5:30 Google Ads API Forum Advisor wrote: > Hi, > > Thank you for reaching out to the Google Ads API support team. > > Please find the answers for your questions below: > > *1. Could you please confirm which Google Ads API endpoint or method > should be used to fetch all location groups?* > > - You need to use the campaign_criterion > > <https://developers.google.com/google-ads/api/fields/v19/campaign_criterion_query_builder> > > resource to retrieve all the location groups from the Google Ads API. As > you are specifically looking for the PMax campaigns, I have build a GAQL > query using which you can retrieve the location groups of a PMax campaigns > in the Google Ads API. You can find the sample GAQL query as per your > requirement: > - > > > SELECT campaign_criterion.criterion_id, campaign_criterion.type, > campaign_criterion.resource_name, > campaign.advertising_channel_type FROM campaign_criterion WHERE > campaign.advertising_channel_type = > 'PERFORMANCE_MAX' AND campaign_criterion.type = 'LOCATION_GROUP' > > - You can use the search > > <https://developers.google.com/google-ads/api/rest/reference/rest/v19/customers.googleAds/search?apix=true> > > or searchStream > > <https://developers.google.com/google-ads/api/rest/reference/rest/v19/customers.googleAds/searchStream?apix=true> > > methods in making the API calls while retrieving the data. Additionally, > you can utilize the Google Ads Query Builder > > <https://developers.google.com/google-ads/api/fields/v19/overview_query_builder> > > and Query Validator > <https://developers.google.com/google-ads/api/fields/v19/query_validator> > to build and validate the queries for retrieving the data from the Google > Ads API. > > *2. When creating a campaign via the API, which field in the campaign > resource should be used to define or associate location groups?* > > - While creating a campaign via the API, you need to use the > campainCriteria method for creating the location groups in the Google Ads > API. I would recommend you to refer to the Create the campaign criteria > > <https://developers.google.com/google-ads/api/performance-max/create-campaign-criteria> > > documentation for more detailed information. Also, you can refer to the > LocationGroupInfo > > <https://developers.google.com/google-ads/api/rest/reference/rest/v19/CampaignCriterion#locationgroupinfo> > > guide for more information. However, I am providing you the sample request > and response logs for creating the location groups for PMax campaign using > the Google Ads API. > - > > *Request Body: > =============== > *POST > https://googleads.googleapis.com/v19/customers/{customerId}/campaignCriteria:mutate?key=[YOUR_API_KEY] > HTTP/1.1 > > developer-token: ********************** > Authorization: Bearer [YOUR_ACCESS_TOKEN] > Accept: application/json > Content-Type: application/json > > { > "operations": [ > { > "create": { > "campaign": "customers/{customerId}/campaigns/{campaignId}", > //PMax campaign ID > "locationGroup": { > "geoTargetConstants": [ > "geoTargetConstants/2008" > ], > "radius": 3000, > "radiusUnits": "METERS", > "locationGroupAssetSets": [ > "customers/{customerId}/assetSets/{assetSetId}" > ] > } > } > } > ] > } > *Response: > =========== > * > HTTP/1.1 200 > content-encoding: gzip > content-length: 128 > content-type: application/json; charset=UTF-8 > date: Thu, 24 Apr 2025 18:03:51 GMT > server: ESF > vary: Origin, X-Origin, Referer > > { > "results": [ > { > "resourceName": > "customers/{customerId}/campaignCriteria/{campaignId}~{campaignCriterionId}" > } > ] > } > > - I hope this clarifies. > > > > Thanks, > > [image: Google Logo] Google Ads API Team > Feedback > How was our support today? > > [image: rating1] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001qUriRIAS> > > [image: rating2] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001qUriRIAS> > > [image: rating3] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001qUriRIAS> > > [image: rating4] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001qUriRIAS> > > [image: rating5] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001qUriRIAS> > [2025-04-24 18:24:57Z GMT] This message is in relation to case > "ref:!00D1U01174p.!500Ht01qUriR:ref" (ADR-00301563) > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 visit https://groups.google.com/d/msgid/adwords-api/023065c9-8ae2-40d0-a5ff-bfe4c07e274an%40googlegroups.com.
