Save bandwidth by getting your reports compressed on the wire

Friday, August 12, 2005


Want to save bandwidth downloading reports? Here's how!

rfc2616 defines a HTTP/1.1 header called Accept-Encoding. This lets HTTP clients ask for a compressed response using a header such as:

Accept-Encoding: gzip
Google servers support gzip encoding, but only for certain HTTP User-Agents. The easiest way to tell Google you really understand gzip encoding is to have the String "gzip" as part of the User-Agent, in addition to using the "Accept-Encoding: gzip" header. If you do that, reports will be transparently compressed and you'll save a lot of download time and bandwidth.

The HTTP User-Agent is different from the useragent SOAP header you use the AdWords API calls: one is used at the transport layer, the other at the application layer. We suggest that you just append the String "gzip" to the default HTTP user agent provided by your toolkit.

This is a PHP 4 sample showing how it's done (it uses libcurl):

  // open connection to the Google server via cURL
$curlConnection = curl_init();
curl_setopt($curlConnection, CURLOPT_URL, $reportURL['getReportDownloadUrlReturn']);
curl_setopt($curlConnection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curlConnection, CURLOPT_ENCODING, "gzip");
curl_setopt ($curlConnection, CURLOPT_USERAGENT, curl_version() . " gzip");
// buffer for downloading report xml
ob_start();
curl_exec($curlConnection);
// buffer report
$reportXml = ob_get_contents();
ob_end_clean();
// end buffering
if (curl_errno($curlConnection)) {
echo "Sorry, there was a problem while downloading your report. The cURL error message is:".curl_error($curlConnection);
return;

(Thanks to Thomas Steiner for the sample.)

Setting HTTP headers can be done easily with any toolkits you use; keep an eye on the AdWords API Forum where other developers may post samples showing how to set these headers using other languages/libraries.

I hope this tip will help you save bandwidth when getting your API reports.

--Patrick Chanezon, AdWords API evangelist

Reminder: new quota structure in effect

Tuesday, August 02, 2005


As we explained a few weeks ago, the new quota structure for the AdWords API went into effect yesterday (August 1st). The Quota & Usage page gives you all the details about the new system. This change has been accompanied by a significant quota increase for most users, so fire up your favorite clients and check out what getUsageQuotaThisMonth returns. We're still working on updating the AdWords online interface, so please use the InfoService calls to retrieve quota allocation and usage information in the meantime. We'll post another note when that update is complete.

--Patrick Chanezon, AdWords API evangelist

New AdWords API features coming soon

Thursday, July 14, 2005


Soon, we'll be changing the Google AdWords keyword evaluation system to help give advertisers more control over keywords they find important.

From an API perspective, there is a new minCpc field in the Keyword object that you can use to determine how much to bid in order to keep a keyword active. Keyword statuses changed a bit in the AdWords online interface, but not in the API.

In addition, with the release of the rate sheet scheduled for Aug. 1, 2005, you should have more keyword stats operations available to adjust to these keyword evaluation changes. For more information on how the new keyword evaluation system impacts the AdWords API, please visit our help page.

--Patrick Chanezon, AdWords API evangelist

New quota structure starting August 1st

Wednesday, July 13, 2005


Starting August 1, we’re introducing a significant change to the AdWords API quota system. The new quota structure will value operation types differently. While some operations will still consume just one quota unit, other operations will consume more - up to 1,000 quota units per operation. For example, generating a report for your whole account will now consume more quota units than downloading stats for a single keyword. As part of this overhaul, we will increase API users’ quota by 10 times. For the majority of API users, we believe this improved quota structure will result in more free API usage. Specifically, we hope this will satisfy the requests we've heard through the Developer Forum for more stats operations. For details, please see the Quota & Usage page.

-- Patrick Chanezon, Adwords API evangelist

Minor change to WSDL files

Tuesday, June 28, 2005


We made a small change to the AdWords API WSDL files today, changing the declared type of KeywordId from int (32 bit) to long (64 bit). The server has treated keyword IDs as longs since our launch, and the online docs declared them as such. Only the WSDL was in error.

Existing client code should see no effect of this. If you regenerate proxy code from the WSDL the type will change, and you may get some minor compile time errors about type conversions. We also are updating the new Java client library and this update will be available shortly.

Many thanks to our user Sabina for pointing out the discrepancy.

-- Nelson Minar, Software Engineer

New features: Creative IDs and Java Client library

Tuesday, June 21, 2005


Hi AdWords API Developers,

We’re happy to announce that we released two new items today: Creative IDs in reports and a Java Client library.

Over the last few months, many of you posted to the Developer Forum stressing the usefulness of Keyword IDs in reports, but wondered why we don’t provide Creative IDs. Based largely on this feedback, you can now schedule a CustomReport with Creative IDs. With Creative IDs, developers can get a full snapshot of their account activity by scheduling a single report. This should improve syncing your local systems with AdWords - enabling more efficient management of your quota.

The Java client library makes it easier to write Java clients. We know that getting started with your AdWords applications can be challenging, so we hope this client library will simplify your Java development process. The client library is provided in a single jar file that contains all the necessary Axis jars and pre-compiled stub classes. More details can be found at the Java Client Library page. As always, please post your thoughts on the Developer Forum . If many of you find client libraries useful, we will work with the community to provide access to more such resources.

Look forward to hearing from you on the Developer Forum.

Regards,

Nelson Minar, Software Engineer
Rohit Dhawan, Product Manager

June 24 System Maintenance

Thursday, June 16, 2005


Hi AdWords API developers,

We are performing routine AdWords system maintenance from 9pm to 11pm PDT on June 24, 2005 (Friday). While all ads will continue to run as normal, you will not be able to perform any API operations during this time.

We apologize for the inconvenience.

Regards,
Rohit Dhawan, Product Manager