My favorites | English | Sign in

Build, Integrate & Sell your App - Google Apps Marketplace!

v2009 Docs | v13 Docs

Documentation for the requested version is not available.Documentation for the requested diff is not available.

Using the Sandbox

Link to this version

The sandbox is a testing and development environment that replicates the functionality of the AdWords API web services. You can use the sandbox to:

  • Develop and test applications without spending API units (calls made in the sandbox are free)
  • Test logic that modifies sandboxed AdWords campaigns (changes in the sandbox never affect live campaigns)
  • Develop an AdWords API client library without having an AdWords account (using the sandbox only requires a Google account)
  • Develop against new or changed AdWords API methods before the changes go live on the production service

Note: The sandbox is not meant to be used for load testing.

Getting Started

To access the sandbox, you must first have a Google account. You can use an existing account or create a new one. You will use this account's email address and password to set the required sandbox request headers.

You use the AdWords API sandbox by connecting to the sandbox-specific versions of the WSDLs instead of the production versions.

When you first access a web service in the sandbox, five sandbox client accounts are automatically created for you. You can work with these client accounts by setting the clientEmail header appropriately.

Your sandbox account starts out empty. You can create new campaigns, ad groups, and ads, and they will be saved to your sandbox account.

Caution: Do not rely on the sandbox to store data for long periods of time. The sandbox is periodically cleared of user and account data, usually once a month.

While you can write and read campaign data as usual, services that provide statistical data (such as TrafficEstimatorService and ReportService) will return intentionally false information. For more information on the behavior of these services, see the following sections in this document:

Back to top

Sandbox WSDL Locations

The sandbox WSDL URLs are identical to their production counterparts, except they use the sandbox.google.com domain instead of adwords.google.com. For example, the sandbox version of the v12 CampaignService is located at the following URL:

https://sandbox.google.com/api/adwords/v12/CampaignService?wsdl <!-- sandbox URL -->

Back to top

Sandbox Request Headers

The AdWords API SOAP headers for the sandbox are similar to the standard request headers, and must be set with the following data:

Header Value Comment
email login_id Email address for the account being accessed. Must be for a valid Google account. Example: joe@gmail.com
password password Password for the Google account used in the email header
useragent application_user_agent An arbitrary string that identifies the customer sending the request (should be the same value the application will use in the production environment)
developerToken login_id++currency_code A string that identifies you as an authorized user of the sandbox. Must be the same login_id used in the email header, followed by ++ and the currency code used by the account.

Example: joe@gmail.com++USD

Also see Note on Currency Code.

clientEmail client_n+login_id Optional.

A header element to be used when a My Client Center (MCC) account edits a client's account. If this header is present, it must have the form client_n+login_id, where 1 ≤ n ≤ 5 and login_id is the same value used in the email header.

Example: client_1+joe@gmail.com

Note on Currency Code

To simplify the use of the sandbox, MCC and Client accounts are created on the fly if they don't already exist in the system. This means sandbox users do not need to go through a registration process. Since the registration process normally allows you to set the account's currency code, sandbox users must provide the currency code in the developerToken header instead. The currency code cannot be changed after the account has been created.

Because sandbox users do not have knowledge or control over when their MCC and Client accounts are created, they must always provide the currency code in the token. Then, if the accounts are implicitly created during a particular request, that currency code will be set for the accounts. If the accounts are already created, then the currency code is ignored. Note that if the token does not include the currency code, the request will fail.

Back to top

Policy Checks

Policy checking is modified in the sandbox such that only repeated punctuation will trigger a policy violation.

Back to top

Image Handling

The sandbox discards any uploaded images and returns the following information for Image objects:

Field Value
height 60
imageUrl https://sandbox.google.com/sandboximages/image.jpg
mimeType image/jpeg
shrunkenUrl https://sandbox.google.com/sandboximages/shrunken.jpg
thumbnailUrl https://sandbox.google.com/sandboximages/thumbnail.jpg
type image
width 468

Back to top

Forcing Error Responses

Since part of developing a robust application involves gracefully handling errors, the sandbox provides a mechanism to simulate AdWords API error responses.

For any request, if you set the email header to login_id++error_code, the response will be the specified error code and a text message indicating the error has been forced by the request. error_code must be one of the AdWords API error codes.

TrafficEstimatorService Behavior

Note: The following numeric ranges use a square bracket to indicate inclusion and a parenthesis to indicate exclusion. For example, [0-20) defines the range of integers including 0 but excluding 20.

In the sandbox, TrafficEstimatorService returns randomly generated stats as follows.

  • Position: random integer in range [0,20)
  • CPC: random integer in range [MAX_CPC/2,MAX_CPC)
  • Clicks per day: random integer in range (1 - (MAX_CPC - CPC) / MAX_CPC) * random [0,500)

The lower and upper values of the previous properties will be randomly calculated in the [0,100%) and [100%,200%) ranges.

Back to top

ReportService Behavior

Sandbox report jobs contain random data unrelated to any live accounts.

In the sandbox, you can create a report job with a status that does not change, or a report job that transitions through the statuses.

To create a report job with a fixed status, include one of these case-insensitive strings in the name field:

  • fixstatus=Pending
  • fixstatus=InProgress
  • fixstatus=Completed
  • fixstatus=Failed

If the report job name does not contain any of these strings, the report job will transition through statuses:

  1. During the first minute since the report job was scheduled, the status is «Pending».
  2. During the second minute, the status is «InProgress».
  3. During the third minute, the status is «Completed».
  4. After the third minute, the report is deleted.

The getAllJobs request returns an array of four DefinedReportJob objects (one for each of value of ReportJobStatus).

The deleteReport request does nothing.

Back to top

KeywordToolService Behavior

The following behavior has changed in the sandbox version of KeywordToolService:

  • Seed-based keyword suggestions

    getKeywordVariations generates two suggestions per keyword:

    1. The keyword text with the word suggestion prepended to it
    2. The word suggestion followed by the keyword words in reverse order.

    For example, a seed of bath towel would generate keywords suggestion bath towel and suggestion towel bath. If the keyword text has only one word, getKeywordVariations returns one suggestion.

  • Content-based keyword suggestions

    getKeywordsFromSite generates site-based keywords in random numbers of groups of suggestions: range of [1,10] groups with includeLinkedPages false, and a range of [1,20] groups with includeLinkedPages true. The number of keywords is [number_of_groups, number_of_groups*10], distributed randomly in the groups, which generates a list of more than 200 keywords.

  • SiteKeyword statistics

    Uses the java.lang.String.hashCode() method against the keyword text to generate the values for searchVolumeScale (text.hashCode() % 6) and advertiserCompetitionScale ((text.hashCode() / 13) % 6).

    Back to top