Retrieve customer data/get campaign report

78 views
Skip to first unread message

Егор Федоров

unread,
Apr 11, 2019, 5:08:08 PM4/11/19
to AdWords API and Google Ads API Forum
Hi,

I'm trying to get info for a customer via oauth credentials with cURL requests and I have some questions:

1) Can I get a list of accessible customers with some info(name/manager/test_account) with one API call, or I need to get a list of customers with listAccessibleCustomers method and then make an API call for each of customer that i retrieved?

2) Can I get a campaign performance report for a manager account? For example, I have a manager account with 2 linked client accounts and each of this accounts have a campaign. Can I get a full report with one API call or do I need to:
  • get a list of clients
  • get a report for campaigns by client
3) Can I define a metric data for a test account/campaign or maybe I can retrieve an empty fields? For example { "impressions": "0", "cpp": "0", ... }

4) Could you explain this behavior for me, please?
   For a request like - 
curl -X POST https://googleads.googleapis.com/v1/customers/<customer_id>/googleAds:search -d "query=SELECT campaign.name, campaign.status FROM campaign WHERE segments.date DURING LAST_30_DAYS" -H "Authorization: Bearer <access_token>" -H "developer-token: <developer_token>" -H "login-customer-id: <manager_id>"

I'm getting a response -
{
  "results": [
    {
      "campaign": {
        "resourceName": "customers/6869456495/campaigns/1767234946",
        "name": "Website traffic-Search-1",
        "status": "ENABLED"
      }
    }
  ],
  "totalResultsCount": "1",
  "fieldMask": "campaign.name,campaign.status"
}

But when I'm adding a new field that can be without info(for example segments.device) -
curl -X POST https://googleads.googleapis.com/v1/customers/<customer_id>/googleAds:search -d "query=SELECT campaign.name, campaign.status, segments.device FROM campaign WHERE segments.date DURING LAST_30_DAYS" -H "Authorization: Bearer <access_token>" -H "developer-token: <developer_token>" -H "login-customer-id: <manager_id>"

I get this response - 
{
  "fieldMask": "campaign.name,campaign.status,segments.device"
}

Can I get a response with available data(like campaign info from 1st request)?

Thanks!

Егор Федоров

unread,
Apr 12, 2019, 6:15:34 AM4/12/19
to AdWords API and Google Ads API Forum
 Also, can I get a report day by day. For example, I need to get a full report for a last month for each day.

googleadsapi...@google.com

unread,
Apr 12, 2019, 1:57:58 PM4/12/19
to efedor...@gmail.com, AdWords API and Google Ads API Forum
Hello, 

1. That's right. The CustomerService.ListAccessibleCustomers is to retrieve only the list of accounts that are directly accessible by your OAuth credentials. This being said, even if your OAuth credentials have directly access to your MCC, this service will not include the sub-accounts under your MCC unless your OAuth credentials has direct access to your sub-accounts as well. You will need to make another API call to pull the Customer details. 

2. You will be able to pull the Campaign Performance Report for the client account. You can get the list of account under the MCC and then run the report for individual client accounts.

3. Yes, you will be able to define the metrics for Test accounts too. Please note that this will not return any data.

4. In the second case, the data is segmented based on Device. If you do not have any Device criteria for the campaigns, it will not return any data. Please check this guide for more information.

Thanks,
Bharani, Google Ads API Team
Reply all
Reply to author
Forward
0 new messages