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 [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/6b721ab1-0f52-40ba-a1c6-fb0ae8910f2dn%40googlegroups.com.