AdsApp.​NegativeKeywordList

  • The content represents a negative keyword list and provides methods for managing it.

  • You can add individual negative keywords or a list of negative keywords with specified match types (broad, phrase, or exact).

  • The list provides methods to retrieve information about the negative keyword list, such as its ID, name, and entity type.

  • You can access selectors to view the search, display, and shopping campaigns the negative keyword list is applied to, as well as the shared negative keywords within the list.

  • There is a method available to set a new name for the negative keyword list.

Represents a negative keyword list.

Methods:

MemberTypeDescription
addNegativeKeyword(keywordText) void Adds a SharedNegativeKeyword to a negative keyword list.
addNegativeKeywords(keywordTexts) void Adds a list of SharedNegativeKeyword objects to a negative keyword list.
campaigns() AdsApp.CampaignSelector Returns a selector of all search and display campaigns this negative keyword list has been applied to.
getEntityType() String Returns the type of this entity as a String, in this case, "NegativeKeywordList".
getId() String Returns the ID of the negative keyword list.
getName() String Returns the name of a negative keyword list.
getResourceName() String Returns the resource name of the negative keyword list.
negativeKeywords() AdsApp.SharedNegativeKeywordSelector Returns a selector of the shared negative keywords in a negative keyword list.
setName(name) void Sets the name of a negative keyword list.
shoppingCampaigns() AdsApp.ShoppingCampaignSelector Returns a selector of all shopping campaigns this negative keyword list has been applied to.

addNegativeKeyword(keywordText)

Adds a SharedNegativeKeyword to a negative keyword list. Match type for the new shared negative keyword is specified as follows:
  • negativeKeywordList.addNegativeKeyword("shoes") - broad match.
  • negativeKeywordList.addNegativeKeyword("\"shoes\"") - phrase match.
  • negativeKeywordList.addNegativeKeyword("[leather shoes]") - exact match.

Returns nothing.

Arguments:

NameTypeDescription
keywordText String The text of the keyword.

addNegativeKeywords(keywordTexts)

Adds a list of SharedNegativeKeyword objects to a negative keyword list. Match type for the new shared negative keywords are specified as follows:
  • negativeKeywordsList.addNegativeKeywords(["planes", "trains"]) - broad match.
  • negativeKeywordsList.addNegativeKeywords(["\"planes\"", "\"trains\""]) - phrase match.
  • negativeKeywordsList.addNegativeKeywords(["[model planes]", "[toy trains]") - exact match.

Returns nothing.

Arguments:

NameTypeDescription
keywordTexts String[] An array of keyword texts.

campaigns()

Returns a selector of all search and display campaigns this negative keyword list has been applied to.

Return values:

TypeDescription
AdsApp.CampaignSelector A selector of all search and display campaigns this negative keyword list has been applied to.

getEntityType()

Returns the type of this entity as a String, in this case, "NegativeKeywordList".

Return values:

TypeDescription
String Type of this entity: "NegativeKeywordList".

getId()

Returns the ID of the negative keyword list.

Return values:

TypeDescription
String The ID of the negative keyword list.

getName()

Returns the name of a negative keyword list.

Return values:

TypeDescription
String The name of a negative keyword list.

getResourceName()

Returns the resource name of the negative keyword list.

Return values:

TypeDescription
String The resource name of the negative keyword list.

negativeKeywords()

Returns a selector of the shared negative keywords in a negative keyword list.

Return values:

TypeDescription
AdsApp.SharedNegativeKeywordSelector A selector of the shared negative keywords in a negative keyword list.

setName(name)

Sets the name of a negative keyword list.

Returns nothing.

Arguments:

NameTypeDescription
name String The new name of the negative keyword list.

shoppingCampaigns()

Returns a selector of all shopping campaigns this negative keyword list has been applied to.

Return values:

TypeDescription
AdsApp.ShoppingCampaignSelector A selector of all shopping campaigns this negative keyword list has been applied to.