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.

Filter products in campaign


When creating a Shopping campaign, you can apply inventory filters to exclude certain products from the campaign. An inventory filter can be created based on one or more values from the fields such as custom label (0-4), product type etc. When an inventory filter is applied to a campaign, only offers that match the filter will be advertised in the campaign. You can create an inventory filter using the AdWords UI or automatically via the AdWords API.

Manual steps

  1. Make sure you have successfully linked the Merchant Center account to the AdWords Account.
  2. Sign into the AdWords account.
  3. Understand which AdWords experience you are using and follow the appropriate steps.
  4. Create a new Shopping campaign selecting:
    1. the associated Merchant Center account.
    2. the Country of Sale for the campaign.
  5. Expand the Shopping Settings section.
  6. Select the Create custom filter option for inventory filter.
  7. In the box shown:
    1. Select the Custom label attribute e.g Custom label 0, you want to filter by. Custom label 0-4 are supported.
    2. Enter the value for the custom label.
  8. To filter by multiple values, click the '+' and repeat step 7.

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 as follows:
      1. Set the campaignId.
      2. Set the criterion to a ProductScope.
      3. Set the dimensions property of the ProductScope to a list ProductDimension object for each filter.
  3. Execute the mutate method of the CampaignCriterionService passing in the list of CampaignCriterionOperation.