Is it possible to add negative keywords to an experiment?

25 views
Skip to first unread message

Johnny

unread,
Jun 24, 2015, 6:09:10 PM6/24/15
to adwor...@googlegroups.com
I'm able to add keywords to an experiment. But how can I add negative keywords? The code below raises:

/home/johnny/.rvm/gems/ruby-2.1.6/gems/google-ads-common-0.9.8/lib/ads_common/parameters_validator.rb:123:in `check_extra_fields': AdsCommon::Errors::UnexpectedParametersError: [:experiment_data] (AdsCommon::Errors::UnexpectedParametersError)
 from /home/johnny/.rvm/gems/ruby-2.1.6/gems/google-ads-common-0.9.8/lib/ads_common/parameters_validator.rb:61:in `
validate_arguments'

And here's the code I'm using:
ad_group_criterion_srv = adwords.service(:AdGroupCriterionService, API_VERSION)
ad_group_criterion
= {
 
:xsi_type => 'NegativeAdGroupCriterion',
 
:ad_group_id => 'xxxxxxx',
 
:criterion => {
   
:xsi_type => 'Keyword',
   
:match_type => 'BROAD',
 
:text => 'Walkabout'
 
},
 
:experiment_data => ad_group_criterion_experiment_data
}
operation
= {
 
:operator => 'ADD', # ADD, SET or REMOVE
 
:operand => ad_group_criterion
}

response
= ad_group_criterion_srv.mutate([operation])

Josh Radcliff (AdWords API Team)

unread,
Jun 25, 2015, 11:01:35 AM6/25/15
to adwor...@googlegroups.com, jon.y...@gmail.com
Hi,

That error is occurring because NegativeAdGroupCriterion does not have an attribute named experimentData. This attribute is not present because experiments do not support negative keywords, whether you're creating the experiment through the API or the user interface.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages