Adding Negative keywords

81 views
Skip to first unread message

Manas Bagul

unread,
Mar 18, 2025, 4:35:28 AM3/18/25
to Google Ads API and AdWords API Forum
Hi, 

Is there a provision in the APIs, specifically v18, to add Account Level Negative Keywords? I know they can be added manually in the account settings (see attached screenshot for reference). But, I want to automate it for multiple accounts. 

Screenshot 2025-03-18 131908.png

Also, can we add Negative Keywords (not lists) to Pmax Campaigns via the API?

Any help in this matter would be appreciated.

Thanks and Regards,
Manas Bagul

***
This communication is confidential, may be privileged, and is meant only for the intended recipient and purpose. No part of this email or any files transmitted with it can be shared, copied, forwarded, published online or offline, or used in any unauthorised manner. If you are not the intended recipient, please preserve the confidentiality of the contents, delete the e-mail and attachments (if any) from your system, and inform the sender immediately.
***

Google Ads API and AdWords API Forum

unread,
Mar 19, 2025, 1:46:33 AM3/19/25
to Google Ads API and AdWords API Forum
Hi,

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

As per the CustomerNegativeCriterionOperation you can only either create or remove. To create the negative keywords on account level, kindly follow the below steps: 
  • You need to verify whether the shared set are created in your account by using the below query. "query":"SELECT shared_set.id, shared_set.member_count, shared_set.name, shared_set.reference_count, shared_set.resource_name, shared_set.status, shared_set.type FROM shared_set WHERE shared_set.type= 'ACCOUNT_LEVEL_NEGATIVE_KEYWORDS' AND shared_set.status='ENABLED'If it's already created you can use the shared set resource name.
  • If not, you need to create a shared set using the Method: customers.sharedSets.mutate request.
Sample Request Body:
====================
POST https://googleads.googleapis.com/v19/customers/{customerId}/sharedSets:mutate?key=[YOUR_API_KEY] HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "type": "ACCOUNT_LEVEL_NEGATIVE_KEYWORDS",
        "name": "Negative Keywords Testing1"
      }
    }
  ]
}
Sample Request body:
=====================
POST https://googleads.googleapis.com/v19/customers/{customerId}/sharedCriteria:mutate?key=[YOUR_API_KEY] HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "keyword": {
          "matchType": "EXACT",
          "text": "Testing keyword1"
        },
        "sharedSet": "customers/3636059788/sharedSets/{sharedSetId}"
      }
    }
  ]
}
Sample Request Body:
===================
POST https://googleads.googleapis.com/v19/customers/3636059788/customerNegativeCriteria:mutate?key=[YOUR_API_KEY] HTTP/1.1

 developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

 {
 "operations": [
   {
    "create": {
      "negativeKeywordList": {
      "sharedSet": "customers/3636059788/sharedSets/{sharedSetId}"
     }
   }
  }
 ]
}    

I hope this helps. Let me know how this goes on your end.

Thanks and Regards, 
Google Ads API team.

Reply all
Reply to author
Forward
0 new messages