google ads search api error

85 views
Skip to first unread message

3P Integration

unread,
Aug 5, 2024, 4:56:57 AM8/5/24
to Google Ads API and AdWords API Forum
hi,
   I need to access google ads search api for my project . i have created test manager and test  client account for testing purpose.
i just tried to call search api 

payload: 
{
  "query": "SELECT campaign.id,metrics.clicks FROM ad_group_ad WHERE segments.date DURING LAST_7_DAYS"
 
}

am getting response is 

{

  "error": {

    "code": 400,

    "message": "Request contains an invalid argument.",

    "status": "INVALID_ARGUMENT",

    "details": [

      {

        "@type": "type.googleapis.com/google.ads.googleads.v17.errors.GoogleAdsFailure",

        "errors": [

          {

            "errorCode": {

              "queryError": "REQUESTED_METRICS_FOR_MANAGER"

            },

            "message": "Metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account."

          }

        ],

        "requestId": "pV2N3M7vPQ_vEpqB2_GJPA"

      }

    ]

  }

}


In google docs i have referred , document says it have to basic service then how to check this api in development mode (test).

could you please suggest to solve this..

thanks for advance.




Google Ads API Forum Advisor

unread,
Aug 5, 2024, 5:59:00 AM8/5/24
to 3pinte...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

I understand that you are encountering the 'REQUESTED_METRICS_FOR_MANAGER' error saying that metrics cannot be requested for a manager account.

Please note that report types of the Google Ads API reporting, especially with metrics, can only be requested against client accounts, not MCC. With this, I would suggest generating a report using a client account that is under the said MCC account.

If you think that you are making a request against your client account but still encountering the same issue, please get back to us with the "complete API logs" (request and response with request-id and request header) generated at your end. Kindly don't redact the details.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vEYWO:ref" (ADR-00260916)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages