Incomplete data returned in Google Ads API response

263 views
Skip to first unread message

Kenneth Oh

unread,
Oct 24, 2019, 3:09:42 PM10/24/19
to AdWords API and Google Ads API Forum
Hello,

Attempting to retrieve data with the Google Ads API using either the Python client library or using HTTP 1.1 results in incomplete data and 404 error messages being returned, respectively, for multiple CID accounts for multiple resources. 

Target resource: Campaigns
Login-customer-id: xxx...
CID account id: xxx...


Python client snippet:

query = """SELECT
      campaign.name,
      campaign.id,
      campaign.status,
      segments.device,
      metrics.impressions,
      metrics.clicks,
      metrics.ctr,
      metrics.average_cpc,
      metrics.cost_micros
    FROM campaign”""

data = ga_service.search(cid, query=query)

Log: google.ads.google_ads.client:183 > Request made: ClientCustomerId: xxx, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v2.services.GoogleAdsService/Search, RequestId: xoVABa1mX1T2opJ6Mdr3PQ, IsFault: False, FaultMessage: None

Expected response: Data for all available campaigns in Google Ads UI
Actual response: Data available for only one campaign out of four




HTTP 1.1 request:
Request headers: 
  • login-customer-id: xxx ...
  • Authorization: Bearer xxx...
  • developer-token: xxx...
  • Content-Type: application/json
Response:
{
  "resourceName": "customers/xxx/campaigns/xxx",
  "id": "xxx",
  "name": CAMPAIGN_NAME",
  "status": ENABLED\,
 …
}
Response:
{
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND",
    "details": [
      {
        "@type": "type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure",
        "errors": [
          {
            "errorCode": {
              "requestError": "RESOURCE_NOT_FOUND"
            },
            "message": "Resource not found."
          }
        ]
      }
    ]
  }

Is there an issue with the Google Ads API servers returning incomplete data?

Google Ads API Forum Advisor Prod

unread,
Oct 24, 2019, 4:52:15 PM10/24/19
to ohtke...@gmail.com, adwor...@googlegroups.com

Hi Kenneth,

Thanks for reaching out. In order for us to further investigate the issue you have, could you please share with us the clientCustomerId you used to run the reports? You could send your reply using the Reply privately to author option.

Thanks and Regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UKOQCy:ref

André Alwy

unread,
Feb 28, 2020, 11:48:39 AM2/28/20
to AdWords API and Google Ads API Forum
I'm having this issue also. Even when I request the basic campaign report, not all of my campaigns return.
More specifically, I have two Display enabled going on, that does no show, and one paused that does show. 
All other campaigns (Search, search with display and App campaigns show correctly)

"SELECT campaign.id,
                campaign.name,
                campaign.network_settings.target_content_network
FROM campaign
ORDER BY campaign.id"

Any Ideas?

Google Ads API Forum Advisor Prod

unread,
Feb 28, 2020, 4:41:12 PM2/28/20
to alw...@gmail.com, adwor...@googlegroups.com

Hi André,

Thanks for reaching out. In order for me to further investigate the issue you have encountered, could you please send me the complete request and response logs along with the client customer id?

Thanks and regards,


Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5001UKOQCy:ref

Alwy

unread,
Mar 2, 2020, 9:28:52 AM3/2/20
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Sure, here it is. I`m using the .net library example:

GoogleAdsServiceClient googleAdsService = client.GetService(
                Services.V2.GoogleAdsService);

            // Create a request that will retrieve all campaigns using pages of the specified
            // page size.
            SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
            {
                PageSize = PAGE_SIZE,
                Query = @"SELECT

                            campaign.id,
                            campaign.name,
                            campaign.network_settings.target_content_network
                        FROM campaign
                        ORDER BY campaign.id",
                CustomerId = customerId.ToString()
            };


My ClientID is "4858178525".

It brings all campaigns other than "Display - Aprendiz" and "Display - Mestres"

This code example gets all campaigns. To add campaigns, run AddCampaigns.cs.
[ "campaign.id", "campaign.name", "campaign.network_settings.target_content_network" ]
Campaign with ID 973143272 and name 'Campanha de Professor' was found.
Campaign with ID 973843578 and name 'Keyword Territory' was found.
Campaign with ID 1486533267 and name 'Android' was found.
Campaign with ID 1486590468 and name 'Aprendizes' was found.
Campaign with ID 1508076843 and name 'Campanha de Professor #2' was found.
Campaign with ID 1524014799 and name 'Mestre' was found.
Campaign with ID 1593777592 and name 'SplitAds' was found.
Campaign with ID 1698578041 and name 'Alunos - Display' was found.
Campaign with ID 1802535065 and name 'Institucional' was found.
Campaign with ID 1989999516 and name 'Idiomas - Aprendiz' was found.
Campaign with ID 2044102472 and name 'Reconhecimento - vídeo youtube' was found.
Campaign with ID 2074491262 and name 'Ciências - Aprendiz' was found.
Campaign with ID 2075452929 and name 'Artes - Aprendiz' was found.
Campaign with ID 2082396391 and name 'Esportes - aprendiz' was found.
Campaign with ID 2083594746 and name 'Ofícios e Hobbies - aprendiz' was found.
Campaign with ID 6464334415 and name 'Idiomas - mestre' was found.
Campaign with ID 6464460186 and name 'Artes - Mestre' was found.
Campaign with ID 6469329493 and name 'Ciências - Mestres' was found.
Campaign with ID 6469443568 and name 'Esportes - Mestre' was found.
Campaign with ID 6469785489 and name 'Ofícios e Hobbies - Mestres' was found.
Campaign with ID 6730891914 and name 'Mestres - geral' was found.
Campaign with ID 6732396154 and name 'Aprendiz - geral' was found.
Campaign with ID 9160177884 and name 'App promotion - Android' was found.
Campaign with ID 9197085488 and name 'App promotion - iOS' was found.
Campaign with ID 973143272 and name 'Campanha de Professor' was found.
Campaign with ID 973843578 and name 'Keyword Territory' was found.
Campaign with ID 1486533267 and name 'Android' was found.
Campaign with ID 1486590468 and name 'Aprendizes' was found.
Campaign with ID 1508076843 and name 'Campanha de Professor #2' was found.
Campaign with ID 1524014799 and name 'Mestre' was found.
Campaign with ID 1593777592 and name 'SplitAds' was found.
Campaign with ID 1698578041 and name 'Alunos - Display' was found.
Campaign with ID 1802535065 and name 'Institucional' was found.
Campaign with ID 1989999516 and name 'Idiomas - Aprendiz' was found.
Campaign with ID 2044102472 and name 'Reconhecimento - vídeo youtube' was found.
Campaign with ID 2074491262 and name 'Ciências - Aprendiz' was found.
Campaign with ID 2075452929 and name 'Artes - Aprendiz' was found.
Campaign with ID 2082396391 and name 'Esportes - aprendiz' was found.
Campaign with ID 2083594746 and name 'Ofícios e Hobbies - aprendiz' was found.
Campaign with ID 6464334415 and name 'Idiomas - mestre' was found.
Campaign with ID 6464460186 and name 'Artes - Mestre' was found.
Campaign with ID 6469329493 and name 'Ciências - Mestres' was found.
Campaign with ID 6469443568 and name 'Esportes - Mestre' was found.
Campaign with ID 6469785489 and name 'Ofícios e Hobbies - Mestres' was found.
Campaign with ID 6730891914 and name 'Mestres - geral' was found.
Campaign with ID 6732396154 and name 'Aprendiz - geral' was found.
Campaign with ID 9160177884 and name 'App promotion - Android' was found.
Campaign with ID 9197085488 and name 'App promotion - iOS' was found.

C:\Users\Shapp\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp3.1\ConsoleApp1.exe (process 27612) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Reply all
Reply to author
Forward
0 new messages