I am using google-ads-api module in nodejs to connect with Google Ads API.

I am using this code block to get Customer

const customer = client.Customer({     customer_id: 'XXX-XXX-XXXX',     refresh_token: refreshToken, }) 

I have used XXX-XXX-XXXX, XXXXXXXXXX, XXXX-XXX-XXX format for customer_id but still it is returning this error

GoogleAdsFailure {   errors: [     GoogleAdsError {       error_code: [ErrorCode],       message: "Invalid customer ID ''."     }   ],   request_id: 'OcUdfalh_N0U4hTJUd6c6g' } 

Tag:google-ads-api, node.js, javascript, adsense

2 comments.

  1. Richard Kang

    from https://developers.google.com/google-ads/api/docs/best-practices/common-errors#client_customer_id_invalid

    i think you should remove the "-" from customer id

  2. Sagar Darekar

    if it's through an environment variable in and IDE like pycharm got to Run > Edit Configurations > Enviroment variables use the format XXXXXXXXXX. Also make sure that the customer id is related to an ads manager account in that case use it's customer id and if it's a regular ads account use it's own customer id.

Add a new comment.