Note: This site explains how to integrate the Google AdWords API, which is no longer being actively developed, with v2 of the Content API for Shopping, which has been deprecated. We recommend migrating to the Google Ads API and v2.1 of the Content API for Shopping.

Add negative keywords to campaign


Negative keywords allow you to prevent a campaign from serving ads for specific keywords. Once you have created a Shopping campaign, you can add negative keywords to exclude the campaign from one or more search terms. Negative keywords can be broad, exact or phrase match. You can create a negative keyword by following the steps for Adwords UI or automatic using Adwords API. These steps summarize the process of creating negative keywords.

Manual steps

  1. Make sure you have already created the Shopping campaign.
  2. Sign into the AdWords account.
  3. Understand which AdWords experience you are using and follow the appropriate steps.
  4. Click the Keywords tab.
  5. Click the Negative keywords tab.
  6. Click the + Keywords button, choosing between ad group or campaign.
  7. Select the ad group or campaign to apply the negative keywords to.
  8. Enter your keywords and click Save.
  9. To change the match type, click on the keyword then select the desired match type and click Save. Supported types include:
    • Broad match (default)
    • Exact match
    • Phrase match

Automatic steps

  1. Make sure you've successfully created a campaign and have a campaign ID.
  2. Create a CampaignCriterionOperation as follows:
    1. Set the operation to ADD.
    2. Set the operand to a NegativeCampaignCriterion as follows:
      • Set the campaignId.
      • Set the criterion to a Keyword by setting the text and matchType.
  3. Execute the mutate method of the CampaignCriterionService passing in the list of CampaignCriterionOperation.