Hello,
I've been wrestling with this for a couple of weeks now and I can really use some clues.
I am using API version v201406. I need to be able to:
1. identify placements (e.g. "
about.com") in a running campaign that has more than N impressions and,
2. CPC of more than $X and then exclude those placements from the campaign.
For 1., I am using ReportService to get the campaign's PLACEMENT_PERFORMANCE_REPORT, which lists its placements along with impressions, CPC etc. from which I can select the placements to be excluded. (The criterionID returned is always "--".)
To remove those placements from the campaigns, I think I need to use MutateJobService.mutate, which takes a list of CampaignCriterionOperations, each with an Operator ("ADD", "REMOVE", or "SET") and a CampaignCriterion. The CampaignCriterion has a Placement, which has an ID and an URL, and this is my problem. I need to get the placement's criterion ID. I tried using CampaignCriterionService.get on the campaign, passing it (in Ruby):
selector = {
:fields => ['CampaignId', 'Id', 'CriteriaType', 'PlacementUrl', ],
:predicates => [
{
:field => 'CampaignId',
:operator => 'EQUALS',
:values => [ campaign_id ]
},
{
:field => 'CriteriaType',
:operator => 'IN',
:values => [ 'PLACEMENT' ]
},
],
:paging => {
:start_index => 0,
:number_results => AdwordsCommon::PAGE_SIZE
}
}
BUT. CampaignCriterionService.get returns a set of placement URLs that is 100% disjoint with the placement URLs that I got from the performance report: the two sets of URLs have nothing in common! What am I doing wrong an what do I actually need to do? Thanks!