I need to add 20 ipAddresses to a campaign IpBlock using Google Adwords API. I need to conserve my API calls and potentially improve speed, so is it possible to NegativeCampaignCriterion using an ipAddressArray instead of one ipAddress at a time. Appreciate pointers if it is possible to add an array of ipAddresses for exclusion.
My current snippet:
foreach ($ipAddressExclusionsAddArray as $ipAddress) {
$IpBlock = new IpBlock();
$IpBlock->ipAddress = $ipAddress;
$IpBlock->type = 'IP_BLOCK';
$campaignCriteria = new NegativeCampaignCriterion($campaignID, null, $IpBlock);
$addOperations[] = new CampaignCriterionOperation($campaignCriteria, 'ADD');
} // each ip address
My attempt to use "new NegativeCampaignCriterion($campaignID, null, $ipAddressExclusionsAddArray);" without the foreach loop, resulted in api error.
Similarly, is it possible to remove an array of ipAddress exclusions.
Appreciate your time!