Adding ipAddress Exclusions in Bulk

219 views
Skip to first unread message

Jake Ellark

unread,
Oct 14, 2014, 6:18:41 PM10/14/14
to adwor...@googlegroups.com
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!

Michael Cloonan (AdWords API Team)

unread,
Oct 16, 2014, 11:25:01 AM10/16/14
to adwor...@googlegroups.com
Hello,

Yes, it should be possible to add these criteria to the Campaign in bulk, but not quite the way you're doing. Each NegativeCampaignCriterion can only take one criterion, but you can add multiple NegativeCampaignCriterions in a single request. You can make an array of operations to pass to the CampaignCriterionService in one request.

Regards,
Mike, AdWords API Team

uvsuperDev

unread,
Jul 22, 2015, 8:19:39 AM7/22/15
to AdWords API Forum
Hello Mike,
Wouldn't this approach ("you can add multiple NegativeCampaignCriterions in a single request. You can make an array of operations to pass to the CampaignCriterionService in one request.") cause Jake to exceed his 10,000 operations limit? (let's say he has 600 campaigns. 600 * 20 IPs is 12,000 operations). 

Michael Cloonan (AdWords API Team)

unread,
Jul 22, 2015, 9:27:21 AM7/22/15
to AdWords API Forum, yuval....@gmail.com
Hello,

The 10,000 operation daily limit is for basic access only. Users with standard access do not have a limit on daily operations. Please see our Rate Sheet for more details, including instructions on how to apply for standard access.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages