Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Windows Live
 Negative Keywords
Windows Live
Negative Keywords

In Microsoft adCenter, negative keywords can be used to prevent an advertisement from being displayed if one or more of these negative keywords are present. For example, if you have an ad group with a keyword of "dog tricks" and a negative keyword of "old," a search for "young dog tricks" would cause a match. However, a search for "old dog tricks" would prevent a match because of the negative keyword.

Negative keywords can be applied at the campaign, ad group, or individual keyword level. Set the negative keywords for a campaign with the Campaign.NegativeKeywords element. Set the negative keywords for an ad group with the AdGroup.NegativeKeywords element. Set the negative keywords for a keyword with the Keyword.NegativeKeywords element. All these properties are an array of strings; each element in the array is a string, and each of these strings is a negative keyword. The total character count for all negative keywords cannot exceed 1,022; no single negative keyword can exceed 100 characters.

Negative keywords are not cumulative. If an entity has any negative keywords, the negative keywords for the higher level entity are not used. The negative keywords are examined in the following order:

  1. Keyword
  2. Ad Group
  3. Campaign

For example, if a keyword has one or more negative keywords, any negative keywords for the ad group and campaign entities are ignored. Similarly, if a keyword has no negative keywords but the ad group that the keyword belongs to does have negative keywords, the negative keywords from the ad group are used and any negative keywords for the campaign are ignored.

Negative keywords for a campaign apply to the preferred language of the account. Negative keywords for an ad group or a keyword apply to the language of the ad group. There is no way to apply campaign negative keywords to another language.

When the negative keywords for an entity are updated, any existing negative keywords are overwritten with the new values. To modify the negative keywords for a keyword, pass a Keyword object along with the new set of negative keywords in the Keyword.NegativeKeywords property to the CampaignManagementServiceClient.UpdateKeywords service operation. The negative keywords for an ad group and a campaign are similarly updated by using the CampaignManagementServiceClient.UpdateAdGroups and CampaignManagementServiceClient.UpdateCampaigns service operations, respectively.

To remove the negative keywords from an existing entity, pass an empty array for the NegativeKeywords property to the appropriate update service operation. For example, to remove the negative keywords from a keyword, pass a Keyword object with an empty array in the Keyword.NegativeKeywords property to the CampaignManagementServiceClient.UpdateKeywords service operation.

Note:
An empty array is not the same as a null array. If you pass a null array to the update service operation, the existing negative keywords are not modified.

The following C# code example shows how to set the Keyword.NegativeKeywords property to an empty array. The code for setting the Campaign.NegativeKeywords and AdGroup.NegativeKeywords properties to an empty array is virtually identical.

Keyword keyword = new Keyword();
keyword.NegativeKeywords = new string[0];

Important:
Microsoft adCenter API version 4 is obsolete and is no longer available. Version 5.1 is the current version. For more information, see Microsoft adCenter API Programming Reference (5.1).
In Microsoft adCenter, negative keywords can be used to prevent an advertisement from being displayed if one or more of these negative keywords are present. For example, if you have an order item with a keyword of "dog tricks" and a negative keyword of "old", a search for "young dog tricks" would cause a match. However, a search for "old dog tricks" would prevent a match because of the negative keyword.

Negative keywords can be applied at either the individual order item level or the campaign level. Set them for an order item by using the AdCenterOrderItem.NotKeywords property. Set the negative keywords for a campaign with the AdCenterCampaign.NotKeywords property. Both of these properties are an array of strings where each element in the array is a string, and each of these strings is a negative keyword. The total character count for all negative keywords cannot exceed 1,022, and no single negative keyword can exceed 100 characters

Campaign negative keywords apply to the preferred language of the account while order item negative keywords only apply to the language that the order applies to. There is no way to apply campaign negative keywords to another language.

Order item negative keywords override any campaign negative keywords. That is, negative keywords are not cumulative. For example, if a keyword match occurs for an order item that has one or more negative keywords, only the order item negative keywords are examined. The only time that campaign keywords are examined is if the order item has no negative keywords.

To modify the negative keywords for an existing order item, pass an AdCenterOrderItem object with the new set of negative keywords in the NotKeywords property to the CampaignManagement.UpdateOrderItems method. The negative keywords will be overwritten when UpdateOrderItems is called. Similarly, to modify the negative keywords from an existing campaign, pass an AdCenterCampaign object with the new set of negative keywords in the NotKeywords array to the CampaignManagement.UpdateCampaigns method.

To remove the negative keywords from an existing order item, pass an AdCenterOrderItem object with an empty array for the NotKeywords property to the CampaignManagement.UpdateOrderItems method.

To remove the negative keywords from an existing campaign, pass an AdCenterCampaign object with an empty NotKeywords array to the CampaignManagement.UpdateCampaigns method.

Note:
An empty array is not the same as a null array.

The following C# code example shows how to set the AdCenterOrderItem.NotKeywords property to an empty array. The code is virtually identical for setting the AdCenterCampaign.NotKeywords property to an empty array.

AdCenterOrderItem orderItem = new AdCenterOrderItem();
orderItem.NotKeywords = new string[0];
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker