Add a negative word

48 views
Skip to first unread message

Сергей Александрович

unread,
Jan 30, 2025, 6:45:51 AM1/30/25
to Google Ads API and AdWords API Forum
Please give an example of a Rest Api request for adding negative words to a campaign

Google Ads API Forum Advisor

unread,
Jan 30, 2025, 10:43:09 AM1/30/25
to che...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Could you please confirm if you are referring to negative keyword?

If so, you can refer to this documentation on the different criteria that you can target/exclude at the campaign. At the campaign level, you can only exclude keywords and you will need to specify negative = true on a keyword's CampaignCriterion, and create it using the CampaignCriterionService.  You can use the customers.campaignCriteria.mutate rest interface method to create, update and remove criteria. You may try the below sample request :
 
{
  "operations": [
    {
      "create": {
        "campaign": "customers/{customer_id}/campaigns/{campaign_id}",
        "keyword": {
          "matchType": "BROAD",
          "text": "sample text"
        },
        "negative": true
      }
    }
  ]
}

If you are not looking for this, share the uncropped screenshot of the Google Ads UI by highlighting the feature you would like to add via the Google Ads API.  
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGz9V:ref" (ADR-00286423)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Google Ads API Forum Advisor

unread,
Jan 30, 2025, 10:44:53 AM1/30/25
to che...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Could you please confirm if you are referring to negative keyword?

If so, you can refer to this documentation on the different criteria that you can target/exclude at the campaign. At the campaign level, you can only exclude keywords and you will need to specify negative = true on a keyword's CampaignCriterion, and create it using the CampaignCriterionService.  You can use the customers.campaignCriteria.mutate rest interface method to create, update and remove criteria. You may try the below sample request :
 
{
  "operations": [
    {
      "create": {
        "campaign": "customers/{customer_id}/campaigns/{campaign_id}",
        "keyword": {
          "matchType": "BROAD",
          "text": "sample text"
        },
        "negative": true
      }
    }
  ]
}
If you are not looking for this, share the uncropped screenshot of the Google Ads UI by highlighting the feature you would like to add via the Google Ads API.  

You can send the details via Reply privately to the author option, or direct private reply to this email.

Сергей Александрович

unread,
Jan 31, 2025, 2:39:36 AM1/31/25
to Google Ads API and AdWords API Forum
Thank you very much! This code works!

четверг, 30 января 2025 г. в 17:44:53 UTC+2, Google Ads API Forum Advisor:
Reply all
Reply to author
Forward
0 new messages