Hi Arnab,
Thank you for reaching out. As seen here, user interest criteria are only supported for negative criterion at the campaign level. You would do this through the CampaignCriterionService. Here is an example for adding supported criterion types to a campaign (or here if you're using Google Ads API).
Regards,
Anthony
Google Ads API Team
I am trying with below request.But it is giving internal error.
# Add the negative campaign criterion.
negative_campaign_criterion_operand = {
'xsi_type': 'NegativeCampaignCriterion',
'campaignId': CAMPAIGN_ID,
'criterion': {
'xsi_type': 'CriterionUserInterest',
'id': '80142'
}
}
operations.append({
'operator': 'ADD',
'operand': negative_campaign_criterion_operand
})
# Make the mutate request.
result = campaign_criterion_service.mutate(operations)
Hi Arnab,
You can follow our developer blog for information regarding future releases.
For your other concern, can you please provide the complete SOAP logs for your request so that we can investigate further? See here for more details on how to enable logging.
Regards,
Anthony
Google Ads API Team
campaign_criterion_service = adwords_client.GetService(
'CampaignCriterionService', version='v201809')
criteria = [{'id': '1000', 'xsi_type': 'Language'}, {'id': '9004400', 'xsi_type': 'Location'}]
criteria.append({
'xsi_type': 'CriterionUserInterest',
'userInterestId': '80142'
})
operations = []
for criterion in criteria:
operations.append({
'operator': 'ADD',
'operand': {
'campaignId': CAMPAIGN_ID,
'criterion': criterion
}
})
result = campaign_criterion_service.mutate(operations)
# Display the resulting campaign criteria.
for campaign_criterion in result['value']:
print('Campaign criterion with campaign id "%s", criterion id "%s", '
'and type "%s" was added.'
% (campaign_criterion['campaignId'],
campaign_criterion['criterion']['id'],
campaign_criterion['criterion']['type']))
In log I saw this :
Campaign criterion with campaign id "7761432172", criterion id "50797975515", and type "USER_INTEREST" was added.
(I have deleted the campaign though later)