Hi Team,
I’d like to confirm whether it’s possible to push the following audience types at the Ad Group level using the Google Ads API v19:
detailed_demographics
life_events
custom_audience
combined_audience
If this is supported, could you please share the recommended process and confirm if the below Java snippet is along the right lines?
// Example: Attaching an audience to an AdGroup
AdGroupCriterion adGroupCriterion = AdGroupCriterion.newBuilder()
.setAdGroup(ResourceNames.adGroup(customerId, adGroupId))
.setStatus(AdGroupCriterionStatus.ENABLED)
.setAudience(
AudienceInfo.newBuilder()
// Replace with the audience type ID
// For example: detailed demographics, life event, custom audience, etc.
.setAudience(ResourceNames.audience(customerId, audienceId))
.build()
)
.build();
AdGroupCriterionOperation operation = AdGroupCriterionOperation.newBuilder()
.setCreate(adGroupCriterion)
.build();
try (AdGroupCriterionServiceClient adGroupCriterionServiceClient =
googleAdsClient.getLatestVersion().createAdGroupCriterionServiceClient()) {
MutateAdGroupCriteriaResponse response =
adGroupCriterionServiceClient.mutateAdGroupCriteria(
String.valueOf(customerId), Arrays.asList(operation));
System.out.printf("Created ad group criterion with resource name: %s%n",
response.getResults(0).getResourceName());
}
Could you confirm if this approach works for:
detailed_demographics
life_events
custom_audience
combined_audience
Or if there are any specific constraints or additional setup steps needed for these audience types?
Thanks in advance for your support!
Best regards,
Abhishek Singh