More Dynamic Ads with Ad parameters

Tuesday, November 24, 2009


We're excited to announce that a new feature of the v2009 API, called Ad parameters, is now available. Ad parameters enable you to change numeric information (for example: prices, discount percentages, etc.) within your text ad, while keeping the history and statistics associated with the ad.

Here's a hypothetical scenario illustrating how Ad parameters might help you make your ads more specific and appealing:

Let's say that you sell high-end antique tea cups on your website and it is important for you to qualify users before they even click on your ads. After running some tests, you have found that you can attract serious buyers to your website by including a starting price in your ads. You also want to include the number of varieties of tea cups you currently have in stock, to make your ad appear fresh.

You would like to update your ad text via the AdWords API in response to price and availability fluctuations within your inventory system, but you don't want to lose the statistics associated with your ad. Ad parameters can solve this problem for you.

With Ad parameters, you can specify an ad like this:


Notice that you can specify default values for param1 and param2 within the ad text. You need to set dynamic numeric values for param1 and param2 at the keyword level via the AdParamService of the v2009 API.

On a certain day, if your inventory of tea cups starts at $80 with 18 designs in stock, you can set these values for the relevant keywords within your ad group, as follows:

keyword
param1
param2
antique cups
$80
18

A user searching for "antique cups" subsequently will see the following ad:


For more information on using Ad parameters, be sure to check out our Discover v2009 blog post on this topic (coming soon).

Finally, a few notes about this feature:
  • Ad parameters can only be updated via the AdWords API. Updates are not currently supported in AdWords Editor or in the AdWords interface
  • You can specify at most two parameters
  • While the default value of the parameters (specified within the ad text) can be non-numeric, the dynamic value of the parameters (specified via the AdWords API) must always be numeric. Currency symbols are allowed
  • As usual, your ads must comply with our AdWords Advertising Policies
-- Shreyas Doshi, Product Manager, AdWords API

Version v200906 beta will be shut down on February 2, 2010

Monday, November 23, 2009


The v200906 API, which we released as a limited beta in June 2009, will be shut down on February 2, 2010. The recently-launched v200909 API is a full replacement for v200906 and it adds substantial additional functionality. For most developers, the migration from v200906 to v200909 will be just a matter of updating the version in the namespace and re-compiling/building their application.

If you are using one of our client libraries, the changes required for migration will be as easy as

  • Java
    • Change import com.google.api.adwords.v200906.cm.CampaignServiceInterface; to import com.google.api.adwords.v200909.cm.CampaignServiceInterface;
    • Change CampaignServiceInterface campaignService = user.getService(AdWordsService.V200906.CAMPAIGN_SERVICE); to CampaignServiceInterface campaignService = user.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
  • DotNet
    • Change using com.google.api.adwords.v200906; to using com.google.api.adwords.v200909;
    • Change namespace com.google.api.adwords.samples.v200906 to namespace com.google.api.adwords.samples.v200909
    • Change CampaignService service = (CampaignService) user.GetService(AdWordsService.v200906.CampaignService); to CampaignService service = (CampaignService) user.GetService(AdWordsService.v200909.CampaignService);
  • Python
    • Explicitly set version, campaign_service = client.GetCampaignService(version='v200909')
  • Ruby
    • Change campaign_srv = adwords.get_service('Campaign', 200906) to campaign_srv = adwords.get_service('Campaign', 200909)
  • Perl
    • Change version in types, Google::AdWords::v200906::Types::SomeType to Google::AdWords::v200909::Types::SomeType
  • PHP
    • Defaults to v200909

As always, the AdWords API team is available to help ensure a smooth transition to the new v200909 API. Feel free to post your questions on the forum. Finally, to learn about the exciting new features of v200909, we encourage you to check out the weekly posts in our Discover v2009 series.

--Stan Grinberg, AdWords API Team

AdWords Downtime: November 14th, 10am-2pm PDT

Tuesday, November 10, 2009


We'll be performing routine system maintenance on Saturday, November 14th from approximately 10:00am to 2:00pm PDT. You won't be able to access AdWords or the API during this time frame, but your ads will continue to run as normal.


Best,
-Eric Koleda, AdWords API Team

Discover v2009: Getting ideas with TargetingIdeaService

Tuesday, November 03, 2009


As we announced recently, KeywordToolService and SiteSuggestionService were among the services deprecated to make way for their v2009 successors. In designing their new replacement, we sought to create a unified experience similar to our other v2009 services. The new TargetingIdeaService combines queries for both keywords and placements into one service with a common method to retrieve TargetingIdeas. In this blog post, we will discuss querying the new service for ideas to aid you in shaping your campaign and how you would go about migrating from v13.

Similar to our other new services, the TargetingIdeaService uses a get method along with a selector to query for both keywords and placements. There are currently two types of requests that can be made - ideas and stats. We will discuss querying for ideas here and save stats for a future blog post.

There are 4 main parameters of the selector which are used for querying ideas:

  • requestType - the request type equal to IDEAS or STATS.
  • ideaType - the type of idea to get equal to KEYWORD or PLACEMENT.
  • searchParameters - contains both the seed parameters as well as filters to apply to the results, which are specific to the ideaType.
  • requestedAttributeTypes - narrows the attributes returned to only those requested, which are specific to the searchParameters and ideaType.

Using these 4 parameters, you will have a vast degree of customization for your results. Each of these parameters and their limitations is best described in the TargetingIdeaSelector documentation page. We will now walk through a few examples on how you would replicate v13's functionality, and how you can improve upon it with v2009.

Replicating KeywordToolService.getKeywordVariations

In v13, you would typically retrieve a list of keyword variations from the getKeywordVariations method. Below is a snippet of code which replicates the basic functionality of this method.

    Keyword keyword = new Keyword();
    keyword.setText("cheap airline tickets");
    keyword.setMatchType(KeywordMatchType.BROAD);

    LanguageTarget language = new LanguageTarget();
    language.setLanguageCode("en");

    CountryTarget country = new CountryTarget();
    country.setCountryCode("US");

    TargetingIdeaSelector selector = new TargetingIdeaSelector();
    selector.setRequestType(RequestType.IDEAS);
    selector.setIdeaType(IdeaType.KEYWORD);
    selector.setSearchParameters(new SearchParameter[] {
      new RelatedToKeywordSearchParameter(null, new Keyword[] {keyword}),
      new LanguageTargetSearchParameter(null, new LanguageTarget[] {language}),
      new CountryTargetSearchParameter(null, new CountryTarget[] {country})});
    selector.setPaging(new Paging(0, 6));

The results you get back may resemble keywords like:

    cheap airline tickets/EXACT
    cheap airline tickets/BROAD
    cheap airline tickets/PHRASE
    airline tickets/BROAD
    airline tickets/EXACT
    airline tickets/PHRASE

As you can see, since the results were not filtered, they weren't that great. You can improve the results by specifying additional search parameters in the selector:

    // Using the same keyword from above, filter by removing the original
    // keyword, by keeping the same match type, and by only choosing
    // "long-tail" keywords.
    new ExcludedKeywordSearchParameter(null, new Keyword[] {keyword}),
    new KeywordMatchTypeSearchParameter(null,
        new KeywordMatchType[] {keyword.getMatchType()}),
    new CompetitionSearchParameter(null,
        new CompetitionSearchParameterLevel[] {
          CompetitionSearchParameterLevel.LOW}),

The results are now more interesting:

    legion air tickets/BROAD
    air tram tickets/BROAD
    block air tickets/BROAD
    sheap air tickets/BROAD
    cheap airfare tracker/BROAD
    cheap airfare forum/BROAD

You will notice now that the results are beginning to give you a better idea on how you would shape your campaign. We will now explore placement functionality, formerly found within the SiteSuggestionService.

Replicating SiteSuggestionService.getSitesByUrls

In v13, you would typically retrieve a list of similar websites to expand your content network campaign using the getSitesByUrls method. Below is a snippet of code which replicates the basic functionality of this method.

    String[] urls = new String[] {"made-up-tickets-site.com",
        "made-up-ticket-seller.com"};

    LanguageTarget language = new LanguageTarget();
    language.setLanguageCode("en");

    CountryTarget country = new CountryTarget();
    country.setCountryCode("US");

    TargetingIdeaSelector selector = new TargetingIdeaSelector();
    selector.setRequestType(RequestType.IDEAS);
    selector.setIdeaType(IdeaType.PLACEMENT);
    selector.setSearchParameters(new SearchParameter[] {
      new RelatedToUrlSearchParameter(null, urls, true),
      new PlacementTypeSearchParameter(null,
         new SiteConstantsPlacementType[] {SiteConstantsPlacementType.SITE}),
      new LanguageTargetSearchParameter(null, new LanguageTarget[] {language}),
      new CountryTargetSearchParameter(null, new CountryTarget[] {country})});
    selector.setPaging(new Paging(0, 6));

The results you get back may resemble placements like:

    made-up-tickets-site.com
    made-up-tickets-site.com::Search Results,Top center
    made-up-ticket-seller.com
    made-up-ticket-seller.com::Homepage,Bottom right
    another-made-up-ticket-seller.com
    yet-another-made-up-ticket-seller.com

Though you now have a better idea of which placements you would like to pursue, you may still have difficulty ranking your results. We will finally discuss pulling additional attributes to help better evaluate targeting ideas.

Requesting more attributes

The TargetingIdeaService adds new functionality not previously found in v13 to help you better understand your results. For example, you may notice from the results above that "another-made-up-ticket-seller.com" looks interesting, but does not offer much information beyond its URL. To investigate, you can request that a sample URL for each placement be supplied to determine if this is the right website for you. You can do this by adding the SAMPLE_URL attribute to the requestedAttributeTypes parameter:

    // PLACEMENT is added to associate with SAMPLE_URL.
    selector.setRequestedAttributeTypes(new AttributeType[] {
      AttributeType.PLACEMENT, AttributeType.SAMPLE_URL});

When the results are returned, you will then be able to visit each sample URL to investigate the location and quality of placement yourself, something that was not previously possible with v13's SiteSuggestionService. All available attributes are listed in the AttributeType documentation page.

As we've shown in this blog post, there are many new and exciting uses for the TargetingIdeaService. We've included examples of using this service in all of our client libraries to help get you started, so please jump in and let us know of any feedback you may have on our forums.

-- Adam Rogal, AdWords API Team

Discover v2009: Asynchronous requests with the BulkMutateJobService

Wednesday, October 28, 2009


Delegation of tasks: we use this concept in our everyday lives when we pay someone to make us coffee, ask a colleague to take care of something while we run to the dentist, or tell our kids or younger siblings to handle a chore. What's common in all these situations? Well, you assign someone a task, possibly consisting of several parts, and then you wait for it to be completed. You can focus on other things while the task is being worked on, but you can still periodically ask what the status is (not too often, or they'll think you're annoying). Eventually they'll tell you it's done, and let you know whether it was successful or not. It's a simple process, and we intuitively know what to expect from it.

Well, you can now delegate complex tasks via the AdWords API! v2009 introduced a unified interface across all services for performing changes: the mutate method. This unification allowed us to develop the BulkMutateJobService, where you can provide a list of mutate operations to be performed for a number of different services, by scheduling a job which gets executed asynchronously. Much like the v13 ReportService, you can then poll for the job status, and once you get back the signal that it's been completed, you can ask for the results.

Let's dive into the details. BulkMutateJobs consist of the following:

  • BulkMutateRequests: these are the different parts of the job. The first one you submit should include a count of how many parts your job has; you submit one at a time, and once the last one is submitted, the job automatically starts. This helps build very large jobs, by avoiding the sending of a single, gigantic request.
  • OperationStreams: a BulkMutateRequest contains one or more OperationStreams, which can be executed in parallel (only in certain conditions, namely if their scopes target different campaigns).
  • Operations: each OperationStream contains a list of Operations, which are performed sequentially.
So to create a job with two parts, you would simply do:
BulkMutateJob job = new BulkMutateJob();
job.setNumRequestParts(2);
and fill in the details for the first part:
BulkMutateRequest part1 = new BulkMutateRequest();
part1.setPartIndex(0);
Then create an operation stream, consisting of several operations (they can even use different operators) and use it in the part:
OperationStream adStream = new OperationStream();
adStream.setScopingEntityId(scopingEntityId);
adStream.setOperations(new Operation[] {
new AdGroupAdOperation(Operator.ADD, null, adGroupAd1, null),
new AdGroupAdOperation(Operator.ADD, null, adGroupAd2, null)});
part1.setOperationStreams(new OperationStream[] {adStream});
Once we're done with that, we can create the JobOperation and submit the first part to the service:
JobOperation jobOperation = new JobOperation();
jobOperation.setOperand(job);
jobOperation.setOperator(Operator.ADD);
job = bulkMutateJobService.mutate(jobOperation);
Long jobId = job.getId();
Submitting the second part is similar, but now we must use the SET operator, since we're adding to an existing job, not creating a new one. Also, we must provide the job ID, so that the system knows which job we're submitting a new part for.
BulkMutateRequest part2 = new BulkMutateRequest();
part2.setPartIndex(1);
// ... OperationStream code goes here ...
job = new BulkMutateJob();
job.setId(jobId); // Here we set the ID to the one we got from
// the response to the first part

job.setRequest(part2);
job = bulkMutateJobService.mutate(new JobOperation(Operator.SET, null, job));
Once all the parts are submitted, the system automatically starts the job. Querying the status is easy, just perform a get with the job ID:
BulkMutateJobSelector selector = new BulkMutateJobSelector();
selector.setJobIds(new long[] {jobId});
BulkMutateJob[] jobs = bulkMutateJobService.get(selector);
job = jobs[0];
Don't query too often, though, or you may run trigger a rate-limiting protection! We recommend 30 seconds as a good value to wait between queries. Once the response comes back with a COMPLETED status, we can retrieve the results for both parts, by setting the resultPartIndex:
selector.setResultPartIndex(0);
jobs = bulkMutateJobService.get(selector);
job = jobs[0];
OperationResult[] operationResults1 =
job.getResult().getOperationStreamResults()[0].getOperationResults();

selector.setResultPartIndex(1);
jobs = bulkMutateJobService.get(selector);
job = jobs[0];
OperationResult[] operationResults2 =
job.getResult().getOperationStreamResults()[0].getOperationResults();
The BulkMutateResult object in the result field of the response includes a list of OperationStreamResults, which themselves are an array of OperationResults. Going through this hierarchy allows you to see which operations were successful and which ones failed, and act accordingly.

Note: If you're looking for a more complete example of using the BulkMutateJobService, please check the examples/demo folder in the client library of your choice. Also check Performing Bulk Jobs with BulkMutateJobService in the API documentation.

With the BulkMutateJobService you can provide as much work as possible to the API in one go and let it do its processing, without worrying about timeouts or broken connections. It won't affect your error handling, either, since the responses detail exactly what happened to all of the operations you performed. It's just an efficient way of getting a lot of work done in a single task. Come in and have a seat, the AdWords API is ready to take your order!

--Sérgio Gomes, AdWords API Team

This is the first of a series of posts on the exciting features of AdWords API v2009. In next week's edition of Discover v2009, we'll tell you all about getting ideas from the new TargetingIdeaService.

Happy Holidays! Enjoy more API units

Tuesday, October 27, 2009


We know the holiday season is a busy time for you and often means a number of updates to your campaigns. We'd once again like to help out by providing you with more API units.

Starting now and extending through January 15th of next year, all developers will receive a bonus of 20% more API units at no additional cost.

  • Developers can purchase API units at the rate of 1250/$0.25, up from 1000/$0.25
  • Advertisers who are eligible for free API units will receive credit at the rate 300/$ of AdWords spend, up from 250/$ of AdWords spend. They will be credited the holiday bonus based on their spend in previous months
You can view your API usage in your MCC account, by clicking the AdWords API Center link under the My Account tab.

As always, we encourage you to use the API as efficiently as possible. See our blog post on efficiency best practices to learn about ways to get more out of your API units. For more general API best practices, see our previous post dedicated to just that topic. Finally, we encourage developers to take advantage of the efficiencies and cost savings associated with API v2009.

Happy Holidays,
-Shreyas Doshi, Product Manager

AdWords API v200909 now available!

Thursday, October 22, 2009


We're happy to announce the newest version of AdWords API v2009! v200909 introduces several new features to the AdWords API; we've highlighted the main points below. For a complete list of the changes in v200909, please see our release notes.


v200909 Highlights
  • Asynchronous calls - Asynchronous calls allow you to work with large sets of data faster and more easily. Instead of having to wait for our system to fully complete your request before you can make another one, you’re now able to make another call as soon as the API service confirms that it has received your previous call. No more waiting for the server to complete large requests. V200909 will continue to support Synchronous methods as well.
  • Keyword and placement ideas - With the new TargetingIdeaService, you'll be able to get keyword and placement ideas through the API, leveraging the functionality of the search-based keyword tool.
  • Location Extensions preview - Limited location extensions functionality is now available as a preview of the full functionality in development.
Coming soon: Over the next few months, we'll continue to introduce new features and additional AdWords functionality. Upcoming features include ReportService, AccountService and the ability to pre-check for errors.

v13 Sunset in 2010:
With the release of equivalent functionality in v200909, the following v13 services will be sunset on April 22, 2010: CampaignService, AdGroupService, CriterionService, AdService, InfoService, KeywordToolService, SiteSuggestionService.

Given that v2009 introduces new concepts and features, we have extended the sunset period for deprecated services to 6 months. If you haven't already begun migrating your systems to the v2009 API, we strongly encourage you to start right away. The deprecation of remaining v13 services (AccountService, TrafficEstimatorService, and ReportService) and accompanying sunset dates will be announced on a future date.

As with every new version of the AdWords API, we encourage you to review the resources in the Developer's Guide to learn more. Additionally, if you aren't using the AdWords API client libraries yet, this is a good time to check them out as they are designed to work with both v2009 and v13.

Best,

Shreyas Doshi, Product Manager and Adam Wooley, Product Marketing Manager