Dear Google Ads API Support,
We’re currently working to automate *Demand Gen campaign setup* using the *Google Ads API (v19, PHP client)*. Our goal is to programmatically apply *audience targeting*—including *interest segments*, *age ranges*, and *genders*—at the *ad group level*. We attempted the following setup to include user interest segments: ``` $audienceIds = [91906, 91904, 91907, 91908]; // Example user interest IDs foreach ($audienceIds as $audienceId) { $adGroupCriterion = new AdGroupCriterion([ 'ad_group' => $adGroupResourceName, 'user_interest' => new UserInterestInfo([ 'user_interest_category' => ResourceNames::forUserInterest($customerId, $audienceId) ]), 'status' => AdGroupCriterionStatus::ENABLED, ]); $adGroupCriterionOperation = new AdGroupCriterionOperation(); $adGroupCriterionOperation->setCreate($adGroupCriterion); $adGroupCriterionOperations[] = $adGroupCriterionOperation; } ``` However, the request failed with this error: ``` CANNOT_ADD_AUDIENCE_SEGMENT_CRITERION_WHEN_AUDIENCE_GROUPED_IS_SET Audience segment attachment is not allowed when use audience grouped bit is set to true. ``` This indicates that *Demand Gen ad groups use audience_grouped* targeting and do not accept individual user_interest criteria directly. We would appreciate your help answering the following: ------------------------------ ✅ What We Need to Know: 1. *What is the correct and supported way to apply the following via the API for Demand Gen ad groups when audience_grouped is enabled?* - Interest segments - Age group targeting - Gender targeting 2. *Is there a recommended structure (e.g., ad_group.audience or similar grouped targeting object) that should be used instead of AdGroupCriterion?* 3. *Can you provide a working example or reference documentation for applying these audience attributes under audience_grouped logic?* 4. *Is it possible to modify these fields post-ad group creation, or must it be done at the time of ad group setup?* ------------------------------ Thank you in advance for your assistance. Best regards, -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/adwords-api/41a05e43-916e-4478-b64b-2e98f64a90f5n%40googlegroups.com.