Google Ads aPI PHP SDK delete IP from Campaign Exclussions
I'm trying to remove IP addresses from a campaign via the API. I'm able to add them fine using ipblockinfo and campaignCriterionOperation but I can't seem to remove it.
The build for the operation looks like :
$campaignCriterion = new CampaignCriterion( [ 'ip_block' => new IpBlockInfo( [ 'ip_address' => $item[ 'ip' ] ] ), 'negative' => true, // setting it to negative 'campaign' => ResourceNames::forCampaign( $customerId, $item[ 'campaignId' ] ) ] );
and to remove it I'm using :
$campaignCriterionOperation->setRemove( $campaignCriterion );
Which is then sent via a mutateCampaignCriteria.
When I use the set remove I get a object to string error. So I looked into the SDK and saw that yes setRemove want's a resource output only as I'm guessing it's about removing the operation not actually removing the ip or criterion specified. Does anyone have any guidance on where to look or how to do a removal of an ip as Googles docs on this aren't very descriptive.
Inside the IPBlockInfo there is also a Clear IP address but this is purely to unset the variable in the object before sending the operation.