Hello, 

To remove placement URL in an ad group, you could use the 
AdGroupCriterionService.mutate 
<https://developers.google.com/adwords/api/docs/reference/v201710/AdGroupCriterionService#mutate>
 and 
set the AdGroupCriterionOperation 
<https://developers.google.com/adwords/api/docs/reference/v201710/AdGroupCriterionService.AdGroupCriterionOperation>
 as 
REMOVE. You may refer to the remove keywords code sample 
<https://developers.google.com/adwords/api/docs/samples/php/basic-operations#remove-a-keyword>
 where 
the keyword is replaced with placement information.

Please find try out the code snippet below and let me know if you run into 
any issues.

const AD_GROUP_ID = 'INSERT_AD_GROUP_ID_HERE'; 
const CRITERION_ID = 'INSERT_PLACEMENT_CRITERION_ID_HERE';

$criterion = new Criterion();
$criterion->setId($criterionId);

// Create an ad group criterion.
$adGroupCriterion = new AdGroupCriterion();
$adGroupCriterion->setAdGroupId($adGroupId);
$adGroupCriterion->setCriterion($criterion);

// Create an ad group criterion operation and add it the operations list.
$operation = new AdGroupCriterionOperation();
$operation->setOperand($adGroupCriterion);
$operation->setOperator(Operator::REMOVE);
$operations = [$operation];

// Remove criterion on the server.
$result = $adGroupCriterionService->mutate($operations);

Regards,
Bharani, AdWords API Team

On Thursday, December 7, 2017 at 4:43:14 AM UTC-5, [email protected] wrote:
>
> This seems not to be working
>
>
>     $placement = new Placement();
>     $placement->setUrl($url);
>
>     // $adGroupCriterion = new BiddableAdGroupCriterion();
>     $adGroupCriterion = new NegativeAdGroupCriterion();
>     $adGroupCriterion->setAdGroupId($adGroupId);
>     $adGroupCriterion->setCriterion($placement);
>     // $adGroupCriterion->setBidModifier($bid_adjustment);
>
>     $adGroupCriterionOperation = new AdGroupCriterionOperation();
>     $adGroupCriterionOperation->setOperand($adGroupCriterion);
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8740f9e3-ee8a-43b9-8113-250a6b85f42d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • how to remove... kendan
    • Re: how ... 'Bharani Cherukuri (AdWords API Team)' via AdWords API Forum
    • Re: how ... Ken Dan Tinio
    • Re: how ... 'Bharani Cherukuri (AdWords API Team)' via AdWords API Forum

Reply via email to