I was able to add UserInterest under campaign.Below I have given the log for reference and python code snippet.Correct my if I am wrong.
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) On Tue, Oct 29, 2019 at 2:27 PM Google Ads API Forum Advisor Prod < adsapiforumadvi...@gmail.com> wrote: > Hi Arnab, > > That is correct. User Interests can only be added at the ad group level. > From the campaign level, it is only available as a negative criteria. > > Here is a snippet you can use to add negative criteria: > negative_campaign_criterion_operand = { > > 'xsi_type': 'NegativeCampaignCriterion', > > 'campaignId': campaign_id, > > 'criterion': { > > 'xsi_type': 'CriterionUserInterest', > > 'userInterestId': '80142', > > } > > } > > Regards, > Anthony > Google Ads API Team > > ref:_00D1U1174p._5001UKOW98:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/CAKVeQME1%2B_YiYMeM9RwCgMdto39_0yW0__z-zC8ykfAseqfPNg%40mail.gmail.com.