Export (0) Print
Expand All

Managing Ads and Keywords

To advertise with a text or mobile ad, then you should bid on keywords. After setting up Campaigns and Ad Groups, you can add Ads and Keywords within each ad group. To advertise with a product ad from your Bing Merchant Center store, then instead of bidding on keywords you should bid using ad group criterion which filters ads from your store. For more information, see Product Ads.

When adding, updating, or deleting ads or keywords in batches of one or more, the operation may succeed for some and fail for part of the batch. For more information, see Partial Success below.

For code examples that show how to add text ads and keywords to a new ad group, and handle partial errors when some ads or keywords are not successfully created, see C# | Java | PHP.

System_CLiX_note Note

For information about related programming elements, see Campaign Management Service Reference.

Partial Success

When adding, updating, or deleting ads or keywords in batches of one or more, the operation may succeed for some and fail for part of the batch. For each list index where an ad was not added, the corresponding element will be null. In the example shown below given three ads attempted, only one of the three nullable long elements within AdIds returned in the response for AddAds contains an ad identifier. The remaining two elements are null, and correspond to the request indices of the failed ads.

The PartialErrors element represents an array of BatchError objects that contain details for any entities that were not successfully added, updated, or deleted. The list only includes a BatchError for unsuccessful attempts, and does not include null elements at the index of each succesfully added ad or keyword. In the example below, two elements are returned for each of the failed request indices (0 and 2).

SOAP Request Example

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ApplicationToken i:nil="true" xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
    <h:AuthenticationToken i:nil="true" xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
    <h:CustomerAccountId xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">AccountIdGoesHere</h:CustomerAccountId>
    <h:CustomerId i:nil="true" xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />
    <h:DeveloperToken xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">DeveloperTokenGoesHere</h:DeveloperToken>
    <h:Password xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">PasswordGoesHere</h:Password>
    <h:UserName xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">UserNameGoesHere</h:UserName>
  </s:Header>
  <s:Body>
    <AddAdsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v9">
      <AdGroupId>AdGroupIdGoesHere</AdGroupId>
      <Ads xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <Ad i:type="TextAd">
          <DevicePreference i:nil="true" />
          <EditorialStatus i:nil="true" />
          <ForwardCompatibilityMap i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
          <Id i:nil="true" />
          <Status i:nil="true" />
          <Type i:nil="true" />
          <DestinationUrl>http://www.alpineskihouse.com/winterglovesale</DestinationUrl>
          <DisplayUrl>AlipineSkiHouse.com</DisplayUrl>
          <Text>Huge Savings on heated gloves.</Text>
          <Title />
        </Ad>
        <Ad i:type="TextAd">
          <DevicePreference i:nil="true" />
          <EditorialStatus i:nil="true" />
          <ForwardCompatibilityMap i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
          <Id i:nil="true" />
          <Status i:nil="true" />
          <Type i:nil="true" />
          <DestinationUrl>http://www.alpineskihouse.com/winterglovesale</DestinationUrl>
          <DisplayUrl>AlipineSkiHouse.com</DisplayUrl>
          <Text>Huge Savings on heated gloves.</Text>
          <Title>Winter Glove Sale</Title>
        </Ad>
        <Ad i:type="TextAd">
          <DevicePreference i:nil="true" />
          <EditorialStatus i:nil="true" />
          <ForwardCompatibilityMap i:nil="true" xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
          <Id i:nil="true" />
          <Status i:nil="true" />
          <Type i:nil="true" />
          <DestinationUrl>http://www.alpineskihouse.com/winterglovesale</DestinationUrl>
          <DisplayUrl>AlipineSkiHouse.com</DisplayUrl>
          <Text>Huge Savings on heated gloves.</Text>
          <Title>Winter Glove Sale</Title>
        </Ad>
      </Ads>
    </AddAdsRequest>
  </s:Body>
</s:Envelope>

SOAP Response Example

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:TrackingId xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">a36a760f-25ae-4418-b572-42dbbe648f19</h:TrackingId>
  </s:Header>
  <s:Body>
    <AddAdsResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v9">
      <AdIds xmlns:a="http://schemas.datacontract.org/2004/07/System" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:long i:nil="true" />
        <a:long>AdIdReturnedHere</a:long>
        <a:long i:nil="true" />
      </AdIds>
      <PartialErrors xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <BatchError>
          <Code>1301</Code>
          <Details i:nil="true" />
          <ErrorCode>CampaignServiceInvalidAdTitle</ErrorCode>
          <Index>0</Index>
          <Message>The Ad's title is invalid.</Message>
          <Type>BatchError</Type>
        </BatchError>
        <BatchError>
          <Code>1313</Code>
          <Details i:nil="true" />
          <ErrorCode>CampaignServiceDuplicateAd</ErrorCode>
          <Index>2</Index>
          <Message>Trying to create a duplicate ad.</Message>
          <Type>BatchError</Type>
        </BatchError>
      </PartialErrors>
    </AddAdsResponse>
  </s:Body>
</s:Envelope>

Community Additions

ADD
Show:
© 2014 Microsoft