I tried this to get impressions, clicks according to location criterion id from my test google ads manager account .But its didn't given me any out put.

24 views
Skip to first unread message

adl test

unread,
Sep 16, 2022, 12:42:07 AM9/16/22
to Google Ads API and AdWords API Forum
public void queryTest(long customerId,String campaignId) {
try (GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
SearchGoogleAdsStreamRequest request =
SearchGoogleAdsStreamRequest.newBuilder()
.setCustomerId(Long.toString(customerId))
.setQuery("SELECT metrics.clicks, metrics.impressions,geographic_view.country_criterion_id FROM geographic_view WHERE geographic_view.country_criterion_id = 1009919")
.build();

ServerStream<SearchGoogleAdsStreamResponse> stream =
googleAdsServiceClient.searchStreamCallable().call(request);

for (SearchGoogleAdsStreamResponse response : stream) {
for (GoogleAdsRow googleAdsRow : response.getResultsList()) {
System.out.println("out put "+googleAdsRow.getGeographicView());
}
}
}

}


out put ====> 2022-09-16 00:25:58.549  INFO [,,,] 56288 --- [ault-executor-0] c.g.ads.googleads.lib.request.summary    : SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v10.services.GoogleAdsService/SearchStream, Endpoint: googleads.googleapis.com:443, CustomerID: 1673682197, 
RequestID: I9pLOoWqSyQM9t-fOPUPcA, ResponseCode: OK, Fault: null.

Google Ads API Forum Advisor

unread,
Sep 16, 2022, 1:42:31 AM9/16/22
to adl773...@gmail.com, adwor...@googlegroups.com

Hi,
 

Thanks for reaching out to the Google Ads API team. I hope you are doing well today.


To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. I ask this so our team further investigates your concern and provides specific recommendations on the issue.


You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.
 

Regards,

Google Logo
Darwin
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ePBx9:ref
Reply all
Reply to author
Forward
0 new messages