Unable to get client ids by AdwordsUser and unable to get AdwordsReport

68 views
Skip to first unread message

Adwords Trapica

unread,
Aug 28, 2018, 6:00:51 AM8/28/18
to AdWords API and Google Ads API Forum
Hi,

I'm new to Google Adwords API and I would appreciate your help.

Since, for now, my clients on boarding manually by link their accounts to mine I don't have the option to get their refresh token but I have mine and I hope it's enough.
When I do the signup process by using URL: https://accounts.google.com/o/oauth2/v2/auth I do get my refresh token, but when I try to get my clients ids by using AdwordsUser I get zero results: {\"totalNumEntries\":0,\"Page.Type\":\"ManagedCustomerPage\"}.
Here's my code (Using node-adwords sdk):

let adwordsUser = new AdwordsUser({
    developerToken : token,
    userAgent : agent,
    clientCustomerId : clientCustomerId,    // xxx-xxx-xxxxx format
    client_id : clientId,                                 // xxxxxx.apps.googleusercontent.com
    client_secret : secret,
    refresh_token : refreshToken
})


let managedCustomerService = adwordsUser.getService('ManagedCustomerService', 'v201806')
let managedCustomerSelector = {
    fields: ['Name', 'CustomerId'],
    ordering: [{field: 'CustomerId', sortOrder: 'ASCENDING'}],
    paging: {startIndex: 0, numberResults: AdwordsConstants.RECOMMENDED_PAGE_SIZE}
}

managedCustomerService.get({serviceSelector: managedCustomerSelector}, (error, results) => {...

Any idea why I can't see the client ids of my customer?



Yet, I can see my customer's client ids in my web console and I'm trying to get insights about their campaigns.
Here's my code (Using node-adwords sdk):

let report = new AdwordsReport({
    developerToken: developerToken,
    userAgent: agent,
    clientCustomerId: clientCustomerId,    // Tried to use my customer's client id and tried to use mine
    client_id: clientId,
    client_secret: secret,
    refresh_token: refreshToken
})

report.getReport('v201806', {
    reportName: `${clientCustomerId} report for ${duration}`,
    reportType: 'CAMPAIGN_PERFORMANCE_REPORT',
    query: query,
    additionalHeaders: {
        skipReportHeader: true,
        skipReportSummary: true,
        skipColumnHeader: true
    },
    format: 'CSV'
}...


but I get: eportDownloadError.INVALID_PARAMETER ... Missing client information
Please advise.

Thanks,
Joab

Bharani Cherukuri (AdWords API Team)

unread,
Aug 28, 2018, 3:34:59 PM8/28/18
to adwor...@googlegroups.com
Hello Joab, 

Can you make sure that you're giving the client customer Id in the config file of the client library that you're using? Could you please share the complete API SOAP request and response logs for the ManagedCustomerService.get() operation so I can take a closer look? You could reply back via Reply privately to author option.

For the second issue, can you make sure that you're specifying the client customer id in the request header while generating the report?

Thanks,
Bharani, AdWords API Team

Bharani Cherukuri (AdWords API Team)

unread,
Aug 29, 2018, 3:24:55 PM8/29/18
to AdWords API and Google Ads API Forum
Hello Joab, 

Thank you for sharing the details privately. Please find my response below for the three set of logs shared:

1. For the logs specific to ManagedCustomerService, it looks like the account is not completely setup. Can you please setup the account completely and retry the API request again? 

2. The CUSTOMER_NOT_FOUND error is triggered when the account specified in the request header is not found. It looks like the CID specified is invalid. Can you make sure that you're using a valid CID and retry the request?

3. Based on the logs shared for the report, it looks like some of the characters are escaped. Could you try using this line: __rdxml: <?xml version="1.0" encoding="UTF-8"?> in the body of your HTTP POST request and retry the request?

Let me know if you run into any issues. 

Thanks,
Bharani, AdWords API Team

On Tuesday, August 28, 2018 at 6:00:51 AM UTC-4, Adwords Trapica wrote:

Adwords Trapica

unread,
Sep 26, 2018, 5:04:33 AM9/26/18
to AdWords API and Google Ads API Forum
Thank you so much for your answer and sorry for the late response (other urgent business needs, but now I'm full on google ad api :)
Can you please clarify what is missing in my account setup, I can't find it? Is it the domain verification?

Joab

Bharani Cherukuri (AdWords API Team)

unread,
Sep 26, 2018, 1:38:22 PM9/26/18
to AdWords API and Google Ads API Forum
Hello Joab, 

You will be able to check this by logging into your account and completing the missing setup. If you're having any trouble completing the setup, you could reach out to the AdWords Product Team using the contact options available here.

Adwords Trapica

unread,
Sep 28, 2018, 12:43:56 PM9/28/18
to AdWords API and Google Ads API Forum
Thanks
Reply all
Reply to author
Forward
0 new messages