API requests fail on production server – “Headers is not defined” and “Failed to fetch” errors

26 views
Skip to first unread message

김채원

unread,
Jul 4, 2025, 5:22:19 AM7/4/25
to Google Ads API and AdWords API Forum

I’m currently implementing the Google Ads API using Node.js. Everything works well in my local development environment, but the following issues occur after deploying to a live HTTPS server.

issue Summary
  1. Localhost: API requests work successfully

  2. Production (HTTPS server):

    • API requests fail with error:

      Failed to fetch
    • JavaScript console logs show:

      Headers is not defined
  3. Browser warning in developer tools:

    Mixed Content: The page was loaded over HTTPS, but requested an insecure resource (favicon via HTTP). This request has been blocked; the content must be served over HTTPS.
Questions
  • What causes the Headers is not defined error when using fetch on the server side?

  • Are there specific CORS or request header configurations required for production use with Google Ads API?

  • Is there a best practice for securely using fetch or any recommended method to avoid these issues?

Please advise on how to resolve this. Let me know if you need a minimal code sample or more details.

Thank you!

Google Ads API Forum Advisor

unread,
Jul 4, 2025, 7:00:11 AM7/4/25
to webm...@inmarketing.kr, adwor...@googlegroups.com
Hi,

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

The Node.js client library is not yet supported in the Google Ads API. As of now, the Google Ads API only supports these client libraries. So, your concern while using the Node.js client library is out of scope for the Google Ads API support team. Similarly, your concerns about the 'Headers is not defined' error in JavaScript console logs and the 'browser warning in developer tools' are also out of scope for us. Our team can only help you with technical queries or concerns related to the Google Ads API.

You can try replicating the issue with one our above client libraries and get back to us with the complete API logs (request and response logs with request-id and request header) generated at your end.

If you haven't enabled logging yet, I would request that you enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby 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.

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

I hope this clarifies.


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-07-04 10:59:29Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01rhEQU:ref" (ADR-00317083)



Reply all
Reply to author
Forward
0 new messages