On Monday, January 23, 2023 at 4:52:12 PM UTC+5:30 Vigneshwaran C wrote: > i have tried to Remove the campaign audience but not working. can you pls > help me to solve. i tried same thing us campaign language and location its > working. but audience is not working. > > $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); > $query ='SELECT > campaign_criterion.user_interest.user_interest_category FROM > campaign_audience_view WHERE campaign.id = '.$google_campaignId; > $stream = $googleAdsServiceClient->Search($customerId, $query); > $audience_remove = []; > foreach ($stream->iterateAllElements() as $googleAdsRow) { > $u_id = > str_replace('customers/$customer_id/userInterests/', '', > $googleAdsRow->getCampaignCriterion()->getUserInterest()->getUserInterestCategory()); > $audience_operation = new CampaignCriterionOperation(); > $audience_remove[] = > $audience_operation->setRemove($googleAdsRow->getCampaignCriterion()->getUserInterest()->getUserInterestCategory()); > } > > $campaignServiceClient = > $googleAdsClient->getCampaignCriterionServiceClient(); > $response = $campaignServiceClient->mutateCampaignCriteria( > $customerId, > $audience_remove > ); > > > -- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager and the sender immediately by e-mail and delete this e-mail from your system
-- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 on the web visit https://groups.google.com/d/msgid/adwords-api/241ad1f1-a318-4426-8d4e-acc0695c05f2n%40googlegroups.com.