excluding placements via API

1,434 views
Skip to first unread message

Berry Tsakala

unread,
Nov 25, 2013, 7:36:22 AM11/25/13
to adwor...@googlegroups.com
I want to exclude specific placements by URLs or other means.
I receive the placements and all metadata from an AWQL query.

I'm looking for documentation or example.

I know how to edit a campaign, but i don't know which object need to be altered for placement exclusion,
and which documentation to find this information at.

Thank you 
Berry

Berry Tsakala

unread,
Nov 25, 2013, 7:58:09 AM11/25/13
to adwor...@googlegroups.com
So far I found this discussion

https://groups.google.com/forum/#!topic/adwords-api/lzqA8W1w7F0
which points to this page in the documentation:
http://code.google.com/apis/adwords/docs/developer/CriterionService.html#setCampaignNegativeCriteria
 - but it doesn't exist (404)

There's also this discussion
https://groups.google.com/forum/#!msg/adwords-api/MpHClRBcLoQ/kzm4WkxY3F0J 

leads to below sourceforge docs:
setCampaignNegativeCriteria
which describes Java, and is hosted in sourceforge

Where is  the official google-adwords-API documentation about it?
(p.s. i'm using python)






Paul Matthews (AdWords API Team)

unread,
Nov 26, 2013, 6:39:12 AM11/26/13
to adwor...@googlegroups.com
Hi Barry,

It seems that you're looking to create a negative ad group criterion. In the particular instance, it looks like you're looking for a placement criterion.

Regards,

- Paul, AdWords API Team.

Berry Tsakala

unread,
Nov 26, 2013, 11:48:20 AM11/26/13
to adwor...@googlegroups.com
I tried today to follow this direction.

(I'd like to exclude the placement for all adGroups, so I use NegativeCampaignCriterion)
here: https://developers.google.com/adwords/api/docs/reference/v201306/CampaignCriterionService.NegativeCampaignCriterion
and:  https://developers.google.com/adwords/api/docs/reference/v201306/CampaignCriterionService.Placement

1. Here's my code. I tried many variations, but i can't figure out how to set the criteria - All my tests gave errors:

operations = [{
     'operator': 'ADD',
     'operand': {
          'type': 'NegativeCampaignCriterion',
          'campaignId': campaign_id,
          'criterion': {
               #'xsi_type': 'placement',
               #'Criterion.Type': 'placement',
               'type': 'placement',
               'url': placement_url,                    # appears in the docs, but gives an error:  Field 'url' is not in type 'Criterion'
               #'placementUrl': placement_url,
               #'id': placement_url,
          }
     }
}]

I can't find an example for this kind of criteria.

2. Also, if criteria.Type is an enumaration, shouldn't PLACEMENT be defined somewhere?
(I grep'ed the code but couldn't find it)

3. Should the the whole operation be "SET" or "ADD"?
i'm confused since i'm ADDing a criteria, but i'm also SETting a campaign.


Thanks, Berry

Paul Matthews (AdWords API Team)

unread,
Nov 27, 2013, 6:39:05 AM11/27/13
to adwor...@googlegroups.com
Hi Berry,

For an example of how to configure the an operation with the AdGroupCriterionService, please take a look at this add_campaign_targeting_criteria.rb example.

It seems that in your code you use 'type' where you should be using the :xsi_type symbol.

Berry Tsakala

unread,
Nov 27, 2013, 7:06:59 AM11/27/13
to adwor...@googlegroups.com
solution:


{
  'operator': 'ADD',
  'operand': {
     'type': 'NegativeCampaignCriterion',
     'campaignId': campaign_id,
     'criterion': {
         'xsi_type': 'Placement',
         'id': '987654321',
         'url': placement_url,
      },
   }
},



On Monday, November 25, 2013 2:36:22 PM UTC+2, Berry Tsakala wrote:

Berry Tsakala

unread,
Dec 1, 2013, 8:08:27 AM12/1/13
to adwor...@googlegroups.com
solution:


{
     'operator': 'ADD',
     'operand': {
     'type': 'NegativeCampaignCriterion',
      'campaignId': campaign_id,
      'criterion': {
            'xsi_type': 'Placement',
            'id': '987654321',
            'url': placement_url,
      },
  }



On Monday, November 25, 2013 2:36:22 PM UTC+2, Berry Tsakala wrote:

Berry Tsakala

unread,
Dec 1, 2013, 8:09:08 AM12/1/13
to adwor...@googlegroups.com
solution:


{
     'operator': 'ADD',
     'operand': {
     'type': 'NegativeCampaignCriterion',
      'campaignId': campaign_id,
      'criterion': {
            'xsi_type': 'Placement',
            'id': '987654321',
            'url': placement_url,
      },
}
   




On Monday, November 25, 2013 2:36:22 PM UTC+2, Berry Tsakala wrote:
Reply all
Reply to author
Forward
0 new messages