So if I understand the examples and documentation correctly, the following 
bit of code should be a pretty efficient way to retrieve all the keywords 
(criterion? as the technical term I guess) within a campaign:

Selector selector = builder.fields("Id", "AdGroupId", "KeywordMatchType", 
"KeywordText").orderAscBy("AdGroupId").offset(offset).limit(PAGE_SIZE).in(
"CampaignId", campaignID.toString()).equals("CriteriaType", "KEYWORD"
).build();

Note that I've passed in a Long campaignID. Then you have an 
adGroupCriterionService get the selector, and then use AdGroupCriterionPage 
to go through all the AdGroupCriterion results. My question is whether 
there is an efficient way to retrieve the campaign name and ad group name 
for each keyword (I want to build a large json object that looks like 
{"keyword":"text" , "adGroupName" : "name" , "campaignName":"name" } , { 
keyword ... } etc.)

I current make one API call as shown above that gets all the keywords in a 
campaign. But then it seems that I have to make individual get requests for 
each keyword to get its adgroup name and its campaign name (this part is 
accomplished with an AdGroupService, that returns an AdGroup object when 
looking up an AdGroupId.) The problem is that doing the AdGroup lookup for 
each keyword (since the criterion result only lets you get an adgroupID, 
not an adGroupName), means that we'll be making an API call for each 
keyword. Obviously this is very expensive and it's causing us to hit our 
API usage limit (basic access).

Please let me know if I've missed something. Essentially I want to retrieve 
campaign name, ad group name, and keyword text for all keywords in a 
campaign. It seems relatively easy to get the IDs for some of these, but my 
understanding is that it'll take thousands of API calls to get the names 
from IDs if the client has thousands of keywords.


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/dbc1d142-1ecd-4d8f-9e41-7d4b4566666f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to