Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

GetHistoricalKeywordPerformance Service Operation

Gets the historical performance of the normalized search term. The results are aggregated by device type.

Request | Response

Error Codes

Service: AdIntelligenceService.svc v9 | Namespace: https://bingads.microsoft.com/AdIntelligence/v9

GetHistoricalKeywordPerformanceRequest Message

Request Body

The GetHistoricalKeywordPerformanceRequest 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

Required

Devices

A list of one or more of the following device types. The default is Computers.

  • Computers

  • NonSmartphones

  • Smartphones

  • Tablets

The response includes keyword performance data for the device types that you specify only, if available. Used to determine a keyword’s performance on the specified device types.

string array

No

Keywords

An array of keywords for which you want to get historical performance statistics. The array can contain a maximum of 1,000 keywords, and each keyword can contain a maximum of 100 characters.

string array

Yes

Language

The language in which the keywords are written.

The countries/regions that you specify in the PublisherCountries element must support the specified language.

For possible values, see Ad Languages.

string

Yes

MatchTypes

The match types for which you want to get historical data.

You may not specify the Content match type.

MatchType array

Yes

PublisherCountries

The country codes of the countries/regions to use as the source of the historical data.

You can specify one or more country codes. Each country/region that you specify must support the language specified in the Language element.

For possible values, see Country Codes.

If Null, the default is all countries/regions that support the specified language.

string array

No

TargetAdPosition

The position of the search results for which you want to get performance data.

For example, to get performance data when ads appeared in the first position of the mainline by using the keyword and match type, set this element to MainLine1. To get performance data when ads appeared in any position of the search results by using the keyword and match type, set this element to All.

The default value is All.

System_CLiX_note Note

If you specify All for AdPosition, the service will return multiple results per keyword for each supported ad position. If you specify Aggregate, the service will return one aggregated result.

AdPosition

No

TimeInterval

The time period that identifies the data to use to determine the key performance index of the specified keywords. For example, use data from the previous seven days or previous 30 days to determine the keyword performance.

The default value is Last7Days.

TimeInterval

No

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/AdIntelligence/v9">
    <Action mustUnderstand="1">GetHistoricalKeywordPerformance</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>
    <GetHistoricalKeywordPerformanceRequest xmlns="https://bingads.microsoft.com/AdIntelligence/v9">
      <Keywords i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string></a1:string>
      </Keywords>
      <TimeInterval i:nil="false"></TimeInterval>
      <TargetAdPosition i:nil="false"></TargetAdPosition>
      <MatchTypes i:nil="false">
        <MatchType></MatchType>
      </MatchTypes>
      <Language i:nil="false"></Language>
      <PublisherCountries i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string></a1:string>
      </PublisherCountries>
      <Devices i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string></a1:string>
      </Devices>
    </GetHistoricalKeywordPerformanceRequest>
  </s:Body>
</s:Envelope>

GetHistoricalKeywordPerformanceResponse Message

Response Body

Element

Description

Data Type

KeywordHistoricalPerformances

An array of KeywordHistoricalPerformance objects. The array contains an item for each keyword, device, match type, and ad position specified in the request. If the keyword is not valid or has no data available, the corresponding item in the array will be null.

KeywordHistoricalPerformance array

Response Header

Element

Description

Data Type

TrackingId

The identifier of the log entry that contains the details of 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/AdIntelligence/v9">
    <TrackingId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></TrackingId>
  </s:Header>
  <s:Body>
    <GetHistoricalKeywordPerformanceResponse xmlns="https://bingads.microsoft.com/AdIntelligence/v9">
      <KeywordHistoricalPerformances xmlns:e9="http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.CampaignManagement.Api.DataContracts" p5:nil="false" xmlns:p5="http://www.w3.org/2001/XMLSchema-instance">
        <e9:KeywordHistoricalPerformance>
          <e9:Keyword p5:nil="false"></e9:Keyword>
          <e9:Device p5:nil="false"></e9:Device>
          <e9:KeywordKPIs p5:nil="false">
            <e9:KeywordKPI>
              <e9:MatchType></e9:MatchType>
              <e9:AdPosition></e9:AdPosition>
              <e9:Clicks></e9:Clicks>
              <e9:Impressions></e9:Impressions>
              <e9:AverageCPC></e9:AverageCPC>
              <e9:CTR></e9:CTR>
              <e9:TotalCost></e9:TotalCost>
              <e9:AverageBid></e9:AverageBid>
            </e9:KeywordKPI>
          </e9:KeywordKPIs>
        </e9:KeywordHistoricalPerformance>
      </KeywordHistoricalPerformances>
    </GetHistoricalKeywordPerformanceResponse>
  </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 Ad Intelligence 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