Export (0) Print
Expand All

GetKeywordOpportunities Service Operation

Gets a list of keyword suggestions that are relevant to the specified ad group. The keyword suggestion also includes a suggested bid value.

System_CLiX_note Note

Currently keyword opportunities are only available in these markets: Australia (AU), Canada (CA), France (FR), Germany (DE), Hong Kong (HK), Taiwan (TW), United Kingdom (GB), and United States (US). It is not recommended to use this service operation for accounts in other markets.

Request | Response

Error Codes

Service: OptimizerService.svc v9 | Namespace: https://bingads.microsoft.com/Optimizer/v9

GetKeywordOpportunitiesRequest Message

Request Body

The GetKeywordOpportunitiesRequest object defines the elements of the request’s body. The elements must be in the same order as shown in the SOAP example.

Element

Description

Data Type

AccountId

The identifier of the account that owns the specified campaign.

The account’s currency must be U.S. Dollar.

long

AdGroupId

The identifier of the ad group to get keyword suggestions for.

The following restrictions apply to the specified ad group.

  • Its language must be set to English.

  • Its distribution medium must include Search.

  • It should contain keywords and ads. The operation will suggest keywords only if the ad group contains one or more ads and keywords; the more keywords and ads that the ad group contains, the richer the set of suggested keywords will be.

long

CampaignId

The identifier of the campaign that owns the specified ad group.

long

IncludeEstimations

When set to true, the estimated impact elements are included in the KeywordOpportunity object. These elements are:

  • EstimatedIncreaseInClicks

  • EstimatedIncreaseInCost

  • EstimatedIncreaseInImpressions

When set to false:

  • the estimated impact elements are included in KeywordOpportunity object when OpportunityType is set to BroadMatch.

  • the estimated impact elements are not included in the KeywordOpportunity object when OpportunityType is set to CampaignContext.

If not specified, the default value is false.

This value is optional.

boolean

OpportunityType

Determines the type or types of keyword opportunities that you want.

If not specified, the default value is CampaignContext.

KeywordOpportunityType

Request Header

For information about the values you set the DeveloperToken, Password, and UserName elements to, see Getting Started With the Bing Ads API.

Element

Description

Data Type

ApplicationToken

The application-access token. This header element is not used and should be null.

string

AuthenticationToken

The OAuth access token used to manage Bing Ads accounts linked to a Microsoft Account. For more information, see Managing User Authentication with OAuth.

string

CustomerAccountId

The identifier of the account that owns the entities in the request.

string

CustomerId

The identifier of the customer that owns the account.

string

DeveloperToken

The client application's developer access token.

string

Password

The Bing Ads user's sign-in password.

string

UserName

The Bing Ads user's sign-in user name. You may not set this element to a Microsoft account.

string

Request SOAP

The following example shows the complete request envelope.


<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Optimizer/v9">
    <Action mustUnderstand="1">GetKeywordOpportunities</Action>
    <ApplicationToken i:nil="false"></ApplicationToken>
    <AuthenticationToken i:nil="false"></AuthenticationToken>
    <CustomerAccountId i:nil="false"></CustomerAccountId>
    <CustomerId i:nil="false"></CustomerId>
    <DeveloperToken i:nil="false"></DeveloperToken>
    <Password i:nil="false"></Password>
    <UserName i:nil="false"></UserName>
  </s:Header>
  <s:Body>
    <GetKeywordOpportunitiesRequest xmlns="https://bingads.microsoft.com/Optimizer/v9">
      <AccountId></AccountId>
      <AdGroupId i:nil="false"></AdGroupId>
      <CampaignId i:nil="false"></CampaignId>
      <IncludeEstimations i:nil="false"></IncludeEstimations>
      <OpportunityType i:nil="false"></OpportunityType>
    </GetKeywordOpportunitiesRequest>
  </s:Body>
</s:Envelope>

GetKeywordOpportunitiesResponse Message

Response Body

Element

Description

Data Type

Opportunities

A list of KeywordOpportunity objects that identifies a suggested keyword and bid value. The list will be empty if there are no suggestions, which may occur if the ad group does not contain existing ads and keywords.

To add one or more of the suggested keywords to your ad group, call the ApplyOpportunities operation.

The list of opportunities includes new opportunities and those that have been previously retrieved, but not applied, and which have not expired.

KeywordOpportunity array

Response Header

Element

Description

Data Type

TrackingId

The identifier of the log entry that contains details about the API call.

string

Response SOAP

The following example shows the complete response envelope.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Optimizer/v9">
    <TrackingId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></TrackingId>
  </s:Header>
  <s:Body>
    <GetKeywordOpportunitiesResponse xmlns="https://bingads.microsoft.com/Optimizer/v9">
      <Opportunities xmlns:e9="http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.Optimizer.Api.DataContracts.Entities" p5:nil="false" xmlns:p5="http://www.w3.org/2001/XMLSchema-instance">
        <e9:KeywordOpportunity p5:type="-- specify derived type here with the appropriate prefix --">
          <e9:AdGroupId></e9:AdGroupId>
          <e9:CampaignId></e9:CampaignId>
          <e9:Competition></e9:Competition>
          <e9:EstimatedIncreaseInClicks p5:nil="false"></e9:EstimatedIncreaseInClicks>
          <e9:EstimatedIncreaseInCost p5:nil="false"></e9:EstimatedIncreaseInCost>
          <e9:EstimatedIncreaseInImpressions p5:nil="false"></e9:EstimatedIncreaseInImpressions>
          <e9:MatchType></e9:MatchType>
          <e9:MonthlySearches></e9:MonthlySearches>
          <e9:SuggestedBid></e9:SuggestedBid>
          <e9:SuggestedKeyword p5:nil="false"></e9:SuggestedKeyword>
          <!--Keep these fields if you set the i:type attribute to BroadMatchKeywordOpportunity-->
          <e9:AverageCPC></e9:AverageCPC>
          <e9:AverageCTR></e9:AverageCTR>
          <e9:ClickShare></e9:ClickShare>
          <e9:ImpressionShare></e9:ImpressionShare>
          <e9:ReferenceKeywordBid></e9:ReferenceKeywordBid>
          <e9:ReferenceKeywordId></e9:ReferenceKeywordId>
          <e9:ReferenceKeywordMatchType></e9:ReferenceKeywordMatchType>
          <e9:SearchQueryKPIs p5:nil="false">
            <e9:BroadMatchSearchQueryKPI>
              <e9:AverageCTR></e9:AverageCTR>
              <e9:Clicks></e9:Clicks>
              <e9:Impressions></e9:Impressions>
              <e9:SRPV></e9:SRPV>
              <e9:SearchQuery p5:nil="false"></e9:SearchQuery>
            </e9:BroadMatchSearchQueryKPI>
          </e9:SearchQueryKPIs>
        </e9:KeywordOpportunity>
      </Opportunities>
    </GetKeywordOpportunitiesResponse>
  </s:Body>
</s:Envelope>

Error Codes

If the service operation fails, it throws a FaultException exception, which contains one or more of the Bing Ads API error data objects. For information about the fault detail objects, see Optimizer Error Data Objects and Handling Service Errors and Exceptions.

The following are example error codes that the error objects can include when using this service operation. For all documented error codes, please see Bing Ads Operation Error Codes.

Error Code

InvalidCredentials

Community Additions

ADD
Show:
© 2015 Microsoft