can a negative placment be un-excluding without remembering first its criterion-ID ?

48 views
Skip to first unread message

Berry Tsakala

unread,
Sep 7, 2014, 12:38:06 PM9/7/14
to adwor...@googlegroups.com
Hi again

I'd like to UN-excluding some placements, via API.

They were excluded either manually or via API's "negative campaign criterion" (see code below).

As far as i know now (which is why I ask), unxcluding a placement would be by removing the criterion in which it's 'negatively' defined.
But I don't always have the Criterion Id to use for deleting that criterion.


1. Can I un-exclude placement only by "PlacementUrl" ?

2. Otherwise, how can I get the negative criterion by it's Placement URL ?
I tried "select Id, CriteriaDestinationUrl, FinalMobileUrl, FinalUrls from CRITERIA_PERFORMANCE_REPORT during 20140820,20140905", which gave errors
I tried "select Id, CriteriaDestinationUrl from CRITERIA_PERFORMANCE_REPORT during 20140820,20140905", but that returned only Criterion Ids, not the placement URLS ...


here's How I exclude placemnets via API:

operations = [ {
               
'operator': 'ADD',
               
'operand': {
                   
'xsi_type': 'NegativeCampaignCriterion',
                   
'campaignId': campaign_id,
                   
'criterion': {
                       
'xsi_type': 'MobileApplication',   # MOBILE_APPLICATION ?
                       
'appId': placement_url,
                   
},
               
}
           
}, ]
Enter code here...

Anash P. Oommen (AdWords API Team)

unread,
Sep 8, 2014, 2:01:43 PM9/8/14
to adwor...@googlegroups.com
Hi Berry,

Why not retrieve all campaign negative criterion where CriteriaType = PLACEMENT and PlacementUrl contains xxx using the CampaignCriterionService? That should give you the ids, and you can delete the criterion to unexclude the placements. See https://developers.google.com/adwords/api/docs/reference/v201406/CampaignCriterionService.Placement for details.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Berry Tsakala

unread,
Sep 18, 2014, 1:14:01 PM9/18/14
to adwor...@googlegroups.com
to answer your rhetorical question:  because it's complicated :)

But i worked it out using your guidelines

Step 1:  get the criterion IDs
using CampaignCriterionService,
 'fields': ['CampaignId', 'Id', 'CriteriaType', 'PlacementUrl',  ],
 
'predicates': [ {
 
'field': 'CriteriaType',
 
'operator': 'IN',
 
'values': ['MOBILE_APPLICATION', ]
 
},


Step 2.
remove the criterion:
  operations = [ {
   
'operator': 'REMOVE',
   
'operand': {
   
'xsi_type': 'CampaignCriterion',
   
'criterion': { 'id': criterion_id }
 
}
}]


Question answered. Thanks.


Reply all
Reply to author
Forward
0 new messages