I can't get some campain from campaign resource

117 views
Skip to first unread message

jeonhwan won

unread,
Oct 9, 2019, 9:48:47 PM10/9/19
to AdWords API and Google Ads API Forum
Hi there,  let say I have 10 campaigns. And for some specific campaign, I can't get the information.
Like I can get only 9 campaigns... one campaign is missing

The interesting thing is when I try AdWords API  I can get all data.  

Is there any possibility I can't get all campaign information when I use Ads API? 
So I must use AdWords API? 




Here is the code for ads API
```
GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient();
        SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder()
                .setCustomerId(testCustomerId) 
                .setPageSize(10000)
                .setQuery("SELECT campaign.id, campaign.name FROM campaign")
                .build();
        GoogleAdsServiceClient.SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
```

This is the code for AdWords API
```
Credential credential = gas.getOfflineCredential(gas.getGoogleMezzoRefreshToken());
            AdWordsSession session = gas.getAdWordsSession(credential, testCustomerId);
            AdWordsServicesInterface adWordsServices =  AdWordsServices.getInstance();
            CampaignServiceInterface campaignService= adWordsServices.get(session, CampaignServiceInterface.class);
int offset = 0;
int page_size = 100;
SelectorBuilder builder = new SelectorBuilder();
            Selector selector = builder
                    .fields(CampaignField.Id, CampaignField.Name, CampaignField.Status)
                    .offset(offset)
                    .limit(page_size)
                    .build();
 do {
               page = campaignService.get(selector);
                log.debug("campaigns count: {}", page.getTotalNumEntries());
} while (offset < page.getTotalNumEntries());
```


jeonhwan won

unread,
Oct 10, 2019, 12:14:48 AM10/10/19
to AdWords API and Google Ads API Forum
And The missing campaign has 1 ad-group, ad-group-type is 'DISPLAY_ENGAGEMENT'.

Google Ads API Forum Advisor Prod

unread,
Oct 10, 2019, 3:24:14 PM10/10/19
to demopro...@gmail.com, adwor...@googlegroups.com

Hi Jeonhwan,

Can you please provide the complete SOAP logs of your API request via reply privately to author? Here is a guide on how to enable logging in the Java client library. Also, can you please provide the campaign ID of the campaign that isn’t showing up?

Regards,
Anthony
Google Ads API Team



ref:_00D1U1174p._5001UKModE:ref

jeonhwan won

unread,
Oct 11, 2019, 12:23:24 AM10/11/19
to AdWords API and Google Ads API Forum
I already sent what u want through 'reply privately to author'  but I'm not sure if the message sent well and I'm not sure where to check the 'reply privately to author'.

1. Query
  
SELECT campaign.id, campaign.name FROM campaign where campaign.id in ('6750323160')



2. campaign-id: 6750323160
3. Log for Ads API
2019-10-11 09:55:34.693  INFO 8960 --- [          Gax-3] c.g.ads.googleads.lib.request.summary    : SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v2.services.GoogleAdsService/Search, Endpoint: googleads.googleapis.com:443, CustomerID: 1129462986, RequestID: OTacyxhmllzkGabD7GkfVQ, ResponseCode: OK, Fault: null.
2019-10-11 09:55:35.263 DEBUG 8960 --- [          Gax-3] c.g.ads.googleads.lib.request.detail     : SUCCESS REQUEST DETAIL.
Request
-------
MethodName: google.ads.googleads.v2.services.GoogleAdsService/Search
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=7987822632, x-goog-api-client=gl-java/1.8.0_161 gapic/ gax/1.45.0 grpc/1.21.0}
Body: customer_id: "1129462986"
query: "SELECT campaign.id, campaign.name FROM campaign where campaign.id in (\'6750323160\')"
page_size: 10000


Response
--------
Headers: Metadata(content-disposition=attachment,content-type=application/grpc,request-id=OTacyxhmllzkGabD7GkfVQ,date=Fri, 11 Oct 2019 00:55:26 GMT,alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000)
Body: field_mask {
 paths: "campaign.id"
 paths: "campaign.name"
}

Failure message: null
Status: Status{code=OK, description=null, cause=null}.





4. Log for Adwords API
2019-10-11 09:56:04.680  INFO 11256 --- [           main] c.m.t.s.g.p.api.GoogleApiService         : limitSleepSec: 320
2019-10-11 09:56:05.982 DEBUG 11256 --- [           main] c.m.t.c.t.i.g.a.s.CampaignReportTest     : AWQL: SELECT CampaignId, CampaignName FROM CAMPAIGN_PERFORMANCE_REPORT WHERE CampaignId IN ["6750323160"]
2019-10-11 09:56:08.094  INFO 11256 --- [           main] c.g.a.a.a.lib.utils.report_download      : Request made: Service: reportdownload Method: POST clientCustomerId: 1129462986 URL: https://adwords.google.com//api/adwords/reportdownload/v201809 Request ID: null ResponseTime(ms): null OperationsCount: null IsFault: false FaultMessage: null




Reply all
Reply to author
Forward
0 new messages