getAll* quota usage

12 views
Skip to first unread message

Zach B

unread,
Sep 13, 2005, 2:53:06 PM9/13/05
to AdWords API Forum
Quick question: the rate sheet indicates that the getAll* operations
consume only 1 quota unit -- they are not listed as "per item"
operations.

Is this accurate? Can I retrieve 10,000 keywords using getAllKeywords,
500 creatives using getAllCreatives, or 100 campaigns using
getAllAdWordsCampaigns for only a single quota unit for each operation?

http://www.google.com/support/adwordsapi/bin/answer.py?answer=21996&topic=-1

Thanks,
Zach

Rajiv M

unread,
Sep 13, 2005, 7:08:40 PM9/13/05
to AdWords API Forum

Coincidentally, this question -- does getAllKeywords(adGroupId)
actually consume only 1 unit total -- has also become critically
important to us as well.

We can't seem to test it, because there seems to be a lag in updating
quota (two consecutive calls to the Info Service won't reveal different
quota usage numbers). Any guidance would be MOST appreciated!

Patrick Chanezon

unread,
Sep 14, 2005, 9:59:14 AM9/14/05
to Rajiv M, AdWords API Forum
Sorry about that. This is a mistake in the reference table.

The Rate Sheet example we give in the documentation is unambiguous that getAll* functions cost as many operations per call as the number of items returned.
http://www.google.com/apis/adwords/quota.html#examples

P@
--
Patrick Chanezon, AdWords API evangelist
http://blog.chanezon.com/
http://www.google.com/apis/adwords/

Rajiv M

unread,
Sep 14, 2005, 10:27:27 AM9/14/05
to AdWords API Forum

YIKES. I'd better go back out my changes now, before we blow through
what little is left of this month's quota!

To the Google folks: PLEASE make sure the rate sheet is up-to-date and
correct. We're doing everything we can to be efficient with our quota
use, but mistakes like these can completely trash our ability to do so
-- and to drive business your way.

-- Rajiv

Richard Jones

unread,
Sep 14, 2005, 11:42:20 AM9/14/05
to Rajiv M, AdWords API Forum
On Tue, Sep 13, 2005 at 04:08:40PM -0700, Rajiv M wrote:
> Coincidentally, this question -- does getAllKeywords(adGroupId)
> actually consume only 1 unit total -- has also become critically
> important to us as well.

No, definitely not! It consumes as many quota units as the keywords
it returns.

> We can't seem to test it, because there seems to be a lag in updating
> quota (two consecutive calls to the Info Service won't reveal different
> quota usage numbers). Any guidance would be MOST appreciated!

Look at the SOAP headers in the RETURNED server response. These
headers contain the number of quota units used and the number of
operations performed.

It'll be something like:

<SOAP:Header>
<impl:operations>100</impl:operations>
<impl:units>1000</impl:units>
</SOAP:Header>

(I just made that up from memory - if you look at a real response
you'll be able to see the headers I mean).

Quick advert: Our Adwords API wrapper automatically counts the number
of operations and units used while running the program and can print
it out at the end.

Rich.

--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com

Zach B

unread,
Sep 14, 2005, 1:47:54 PM9/14/05
to AdWords API Forum
Thanks.

For PHP+nusoap developers, you can access the SOAP response headers
using the soapclient::getHeaders() function after making your service
call.

eg (following the syntax from the Google PHP examples):

<?
$response = $client->call("getAllWhatever", $param);
$responseHeaders = $client->getHeaders();
print $responseHeaders();
?>

The above snippet should give you a sense of the SOAP response headers.

tomasvdb

unread,
Sep 15, 2005, 6:22:40 AM9/15/05
to AdWords API Forum
example for java users:

CampaignService cs = new
CampaignServiceServiceLocator().getCampaignService();

Campaign [] cps = cs.getAllAdWordsCampaigns(0);

SOAPHeaderElement[] headers = ((Stub) cs).getResponseHeaders();

for (SOAPHeaderElement h: headers){
System.out.println(h.getName());
System.out.println(h.getValue());
}

Patrick Chanezon

unread,
Sep 15, 2005, 12:07:07 PM9/15/05
to Rajiv M, AdWords API Forum
The rate sheet has now been fixed on the site: http://www.google.com/support/adwordsapi/bin/answer.py?answer=21996
Sorry for the inconvenience.
http://www.google.com/apis/adwords/

Rajiv M

unread,
Sep 15, 2005, 1:20:08 PM9/15/05
to AdWords API Forum

Thanks Patrick.

The fact that this KeywordService.getAllKeywords was in error makes me
suspicious of some other operations that, on the updated rate sheet,
are not "per item." For example:

KeywordService.getActiveKeywords -- does it cost 1 unit regardless of
how many keywords are returned?
KeywordService.getKeywordStatus -- 1 unit regardless of how many stats
records?

And I kind of hate to bring it up, but why would anybody use
setKeywordListMaxCpc at a cost 10 per item when one can accomplish the
same thing for only 2 per item using getKeywordList and
updateKeywordList? (Or are these published costs incorrect?)

-- Rajiv

Richard Jones

unread,
Sep 16, 2005, 7:01:09 AM9/16/05
to Rajiv M, AdWords API Forum
On Thu, Sep 15, 2005 at 10:20:08AM -0700, Rajiv M wrote:
> And I kind of hate to bring it up, but why would anybody use
> setKeywordListMaxCpc at a cost 10 per item when one can accomplish the
> same thing for only 2 per item using getKeywordList and
> updateKeywordList? (Or are these published costs incorrect?)

We are using updateKeywordList at a cost of 1 per keyword.

Rajiv M

unread,
Sep 16, 2005, 11:16:27 AM9/16/05
to AdWords API Forum

Richard Jones wrote:
> On Thu, Sep 15, 2005 at 10:20:08AM -0700, Rajiv M wrote:
> > And I kind of hate to bring it up, but why would anybody use
> > setKeywordListMaxCpc at a cost 10 per item when one can accomplish the
> > same thing for only 2 per item using getKeywordList and
> > updateKeywordList? (Or are these published costs incorrect?)
>
> We are using updateKeywordList at a cost of 1 per keyword.
>
> Rich.

Can you get away with leaving all the fields other than ID and maxCpc
unassigned -- does that leave those fields untouched during the update?
We've been retrieving the keywords before updating their maxCpcs so as
to leave the other mutable fields with their original values.
(Retrieve + Update = 2 units) Maybe that's not necessary...

Richard Jones

unread,
Sep 17, 2005, 12:28:48 PM9/17/05
to Rajiv M, AdWords API Forum
On Fri, Sep 16, 2005 at 08:16:27AM -0700, Rajiv M wrote:
> Can you get away with leaving all the fields other than ID and maxCpc
> unassigned -- does that leave those fields untouched during the update?
> We've been retrieving the keywords before updating their maxCpcs so as
> to leave the other mutable fields with their original values.
> (Retrieve + Update = 2 units) Maybe that's not necessary...

Actually I don't know. OCaml, the language we use, has a very useful
operator for copying whole structures and changing just a few
elements. That is, { structure with element = new_value }. So
assuming a list called 'keywords' which we need to change to
'new_max_cpc', we can write something like:

let keywords = List.map (
fun keyword -> { keyword with keyword_maxCpc = new_max_cpc }
) keywords in
updateKeywordList keyword_svc keywords;

which is very succinct.
Reply all
Reply to author
Forward
0 new messages