Google Ads API Node.js MCC Setup: TypeError 'Cannot read properties of undefined (reading get)' in customer.report

6 views
Skip to first unread message

Ritik Awachat

unread,
Oct 10, 2025, 1:04:05 AM (yesterday) Oct 10
to Google Ads API and AdWords API Forum

Hi all,

I'm trying to fetch campaign data from a Google Ads client account via a newly created MCC (manager) account using the google-ads-api library (v21.0.1) in Node.js. I followed these steps:

  • Created my own MCC account.

  • Received and accepted an invitation from the client, giving me read-only access to their account.

  • Verified the client account is showing under my MCC account in the Google Ads UI.

  • Acquired OAuth refresh token (flow works, tokens issued).

  • Developer token is APPROVED for standard access.

  • Using client IDs and MCC IDs without dashes.

Here’s the code I’m running:

js
const { GoogleAdsApi, enums } = require('google-ads-api'); const client = new GoogleAdsApi({ client_id: '...', client_secret: '...', developer_token: '...', }); const customer = client.Customer({ customer_id: 'xxxxxxxxxx', // client/customer account (no dashes) login_customer_id: 'yyyyyyyyyy', // my MCC account (no dashes) refresh_token: '...', }); async function fetchCampaigns() { try { const campaigns = await customer.report({ entity: 'campaign', attributes: ['campaign.id', 'campaign.name'], metrics: ['metrics.impressions', 'metrics.clicks'], limit: 10, constraints: { 'campaign.status': enums.CampaignStatus.ENABLED, }, }); if (!campaigns || campaigns.length === 0) { console.log('No campaigns found'); return; } campaigns.forEach(campaign => { console.log(`ID: ${campaign['campaign.id']}, Name: ${campaign['campaign.name']}`); }); } catch (error) { console.error('Error fetching campaigns:', error); } } fetchCampaigns();

But every run gives me this error:

text
No data type found for reason No data type found for domain No data type found for metadata.service No data type found for metadata.method Error fetching campaigns: TypeError: Cannot read properties of undefined (reading 'get') at Customer.getGoogleAdsError (.../google-ads-api/build/src/service.js:102:49) ...

Things I've already checked:

  • Both IDs are correct and have full account access (client account appears in MCC UI).

  • Developer token, OAuth credentials, and permissions should be valid.

  • Dashes have been removed from IDs.

  • Tried with and without login_customer_id.

  • Using latest Node 20+ and latest google-ads-api package.

Questions:

  • Is this error due to account permissions, API setup, or a bug in the library?

  • Any additional steps needed after accepting a client account invitation in MCC?

  • Should API access work for an MCC managing a client with read-only access, or is higher permission needed?

  • Has anyone resolved this 'undefined get' error in google-ads-api/report?

Any help or insight would be greatly appreciated!

Google Ads API Forum Advisor

unread,
Oct 10, 2025, 4:39:44 AM (23 hours ago) Oct 10
to ritika...@gmail.com, adwor...@googlegroups.com
Hi,

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

Based on the information provided, I understand that you are trying to retrieve the campaign details using the Node.js library in the Google Ads API and encountering issues. Kindly note that you have provided the code but we need the complete API logs (request and response logs with request-id and request header) generated at your end to further assist you better. As you are using the Node.js library which is not an official library as per the API documentation, so I would request you to enable the logging at your end and provide us the complete API logs. If you are not able to share the logs, then at least share us the request-ids to further investigate at our end. 

Additionally, I don't think the error message is anything specific with the Google Ads API issue rather we assume it's something related to the Node.js client library. If this error is specific with your client library issue, then note that we don't test, contribute to, or maintain these libraries. You can use them at your own risk. Any questions you may have should be directed to the owners of the open source projects. If you can provide the request-ids we can check and confirm whether the issue is related to the client library or whether it's related to the Google Ads API error. 

You can send the details via Reply privately to the author option, or direct private reply to this email.
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-10-10 08:39:02Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u8mu5:ref" (ADR-00335107)



Reply all
Reply to author
Forward
0 new messages