Google Groups

Re: How to get ClickType, Device Stats using get service of AdGroupService


Kevin Winter Jul 24, 2012 2:31 PM
Posted in group: AdWords API Forum
Hi,
  We strongly encourage you to use Reports where statistics are concerned.  Reports are faster, cost less units and impose less burden on our servers.  Additionally, you cannot perform segmentation with the existing SOAP services.

- Kevin Winter
AdWords API Team

On Friday, July 20, 2012 8:41:10 AM UTC-4, road11 wrote:
Not sure it's possible using the AdGroupService. As I look through the API doces (https://developers.google.com/adwords/api/docs/reference/v201109_1/AdGroupService), I don't see any place where those data items are selectable. I haven't been working with this API for a long time, but what I've seen is if you want metrics that get down to a granular level like that, you pretty much have to use AdHocs. But I could be wrong (somebody correct me if I am).
 
Eric

On Friday, July 20, 2012 4:58:42 AM UTC-4, Sanju wrote:
Hi,

how can I get Stats of adGroup with respect of Device, Search and Display network and ClickType using get service of AdGroupService. I can get through AdHoc reports but I want to get through get service.

My code follows like this:

Long adrpId = Long.parseLong("XXXXX");
Selector selector = new Selector();
String startDate ="20120701";
String endDate = "20120701";
selector.setDateRange(new DateRange(startDate, endDate));
selector.setFields(new String[] {
"AdGroupName","CampaignId","AdGroupId","Status", "AdNetworkType1","AdNetworkType2","Device", "ClickType",
"Impressions", "Clicks", "Cost", "Conversions","AveragePosition","ConversionsManyPerClick"
});


    Predicate adgrpIdPredicate = new Predicate("Id", PredicateOperator.IN, new String[] {adrpId.toString()});
selector.setPredicates(new Predicate[] {adgrpIdPredicate});

// Get all ad groups.
AdGroupPage page = adGroupService.get(selector);

// Display ad groups.
if (page.getEntries() != null) {
for (AdGroup adGroup : page.getEntries()) {
  ////////// here I need to display each adgroup clicks, impressions of network and device wise 
}
}


Thnx in adv.