함수 이름의 철자가 올바르고 철자 대소문자가 올바른지 확인합니다.예를 들면 다음과 같습니다. AdsApp.keywordz()는 keywordz이 AdsApp 클래스의 유효한 함수가 아니므로 이 오류가 발생합니다.
keywords() 함수의 맞춤법 대소문자가 잘못되어 AdsApp.Keywords()도 실패합니다.
이 문제의 가장 일반적인 원인은 작업을 실행하는 함수가 있지만 main() 메서드에서 호출하지 않는 것입니다. 이 문제는 일반적으로 Google 문서에서 코드 스니펫을 복사하여 붙여넣을 때 발생합니다.
코딩 접근방식
코드 스니펫
버전 1 (작동하지 않음)
function main() {
// Call to getCampaigns is missing, so this script does nothing.
}
function getCampaigns() {
// AdsApp.campaigns() will return all Search and Display campaigns
// that are not removed by default.
let campaignIterator = AdsApp.campaigns().get();
console.log('Total campaigns found : ' +
campaignIterator.totalNumEntities());
while (campaignIterator.hasNext()) {
let campaign = campaignIterator.next();
console.log(campaign.getName());
}
}
버전 2 (작동하지 않음)
function main() {
// Call to getCampaigns is missing, so this script does nothing.
function getCampaigns() {
// AdsApp.campaigns() will return all Search and Display campaigns
// that are not removed by default.
let campaignIterator = AdsApp.campaigns().get();
console.log('Total campaigns found : ' +
campaignIterator.totalNumEntities());
while (campaignIterator.hasNext()) {
let campaign = campaignIterator.next();
console.log(campaign.getName());
}
}
}
버전 3 (작품)
function main() {
getCampaigns();
}
function getCampaigns() {
// AdsApp.campaigns() will return all Search and Display campaigns
// that are not removed by default.
let campaignIterator = AdsApp.campaigns().get();
console.log('Total campaigns found : ' +
campaignIterator.totalNumEntities());
while (campaignIterator.hasNext()) {
let campaign = campaignIterator.next();
Logger.log(campaign.getName());
}
}
스크립트를 업그레이드할 때 '함수 getFinalUrl을 찾을 수 없음' 오류가 표시됨
업그레이드된 URL과 함께 작동하도록 스크립트를 변경할 때 이 오류가 발생할 수 있습니다. 이 오류는 ad.getDestinationUrl() 호출을 ad.getFinalUrl()로 대체할 때 발생합니다.
getFinalUrl()은 AdUrls 클래스의 일부이므로 코드를 ad.urls().getFinalUrl()로 변경해야 합니다.
functionmain(){// Incorrect snippet. getFinalUrl is not a member of the Ad class.letad=AdsApp.ads().get().next();leturl=ad.getFinalUrl();// Correct snippet.letad=AdsApp.ads().get().next();leturl=ad.urls().getFinalUrl();}
X에 대한 통계가 표시되지 않음
보고서를 실행하거나 통계를 호출할 때 특정 항목 또는 기간의 데이터를 사용할 수 없는 경우가 흔히 발생합니다. 다음과 같은 방법을 시도해 볼 수 있습니다.
통계를 가져오거나 보고서를 실행하는 기간을 확인합니다.
여러 통화의 계정을 관리하는 Google Ads 스크립트의 계정 수준 통계를 가져오면 관리자 계정의 통화로 비용이 반환됩니다.
아직 Google Ads에 원하는 데이터가 없을 수 있습니다. 자세한 내용은 데이터 업데이트 가이드를 참고하세요.
기능 X는 어떻게 사용하나요?
특정 기능을 사용하는 방법의 예는 코드 스니펫 및 솔루션을 참고하세요. 적절한 코드 스니펫을 찾을 수 없는 경우 포럼에 요청을 제출하세요.
여전히 지원이 필요하신가요?
Google에서 지원할 수 있는 분야에 도움이 필요한 경우 도움 받기 페이지를 방문하세요.
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[[["\u003cp\u003eThis page addresses common Google Ads script errors and questions, focusing on general JavaScript issues and not solution-specific ones.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors include misspelled function names, scripts that run but don't execute actions, and issues related to Upgraded URLs.\u003c/p\u003e\n"],["\u003cp\u003eScripts may fail to retrieve stats due to incorrect date ranges, currency mismatches in Ads Manager accounts, or Google Ads data processing delays.\u003c/p\u003e\n"],["\u003cp\u003eFor specific feature usage, refer to the provided code snippets and solutions, or request help in the forum.\u003c/p\u003e\n"],["\u003cp\u003eFor further assistance, consult the designated "Get Help" page for support resources.\u003c/p\u003e\n"]]],[],null,["# Common Issues\n\nThis is a compilation of the most common issues raised in the\n[Google Ads scripts forum](//groups.google.com/forum/#!forum/adwords-scripts).\n| **Note:** This page only lists general questions related to Scripts. If your question is specific to a [solution](/google-ads/scripts/docs/solutions), refer to the corresponding solutions page.\n\nCommon JavaScript errors\n------------------------\n\n### Script is failing with \"Cannot find function: FUNCTION_NAME\"\n\nThis is usually the result of a misspelled function name in the script.\n\n1. Check that the function name is spelled correctly and has the correct\n spelling case; e.g., `AdsApp.keywordz()` will result in this error, because\n `keywordz` is not a valid function in the\n [AdsApp](/google-ads/scripts/docs/reference/adsapp/adsapp) class.\n `AdsApp.Keywords()` will also fail due to incorrect spelling case for the\n `keywords()` function.\n\n2. Check that the function exists; e.g., `AdsApp.keywords().next()` will fail\n because\n [`AdsApp.keywords()`](/google-ads/scripts/docs/reference/adsapp/adsapp#keywords)\n returns a\n [`KeywordSelector`](/google-ads/scripts/docs/reference/adsapp/adsapp_keywordselector)\n while `next()` is a method for a [`KeywordIterator` object](/google-ads/scripts/docs/reference/adsapp/adsapp_keyworditerator).\n The correct code would be `AdsApp.keywords().get().next()`.\n\n### My script runs, but doesn't do anything\n\nThe most common reason for this issue is that you have a function that performs\nan operation, but you are not calling it from the `main()` method. This\ncommonly happens when you copy-paste\n[code snippets](/google-ads/scripts/docs/examples) from our documentation.\n\n| Coding approach | Code snippet |\n|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Version 1 (doesn't work)** | ``` function main() { // Call to getCampaigns is missing, so this script does nothing. } function getCampaigns() { // AdsApp.campaigns() will return all Search and Display campaigns // that are not removed by default. let campaignIterator = AdsApp.campaigns().get(); console.log('Total campaigns found : ' + campaignIterator.totalNumEntities()); while (campaignIterator.hasNext()) { let campaign = campaignIterator.next(); console.log(campaign.getName()); } } ``` |\n| **Version 2 (doesn't work)** | ``` function main() { // Call to getCampaigns is missing, so this script does nothing. function getCampaigns() { // AdsApp.campaigns() will return all Search and Display campaigns // that are not removed by default. let campaignIterator = AdsApp.campaigns().get(); console.log('Total campaigns found : ' + campaignIterator.totalNumEntities()); while (campaignIterator.hasNext()) { let campaign = campaignIterator.next(); console.log(campaign.getName()); } } } ``` |\n| **Version 3 (works)** | ``` function main() { getCampaigns(); } function getCampaigns() { // AdsApp.campaigns() will return all Search and Display campaigns // that are not removed by default. let campaignIterator = AdsApp.campaigns().get(); console.log('Total campaigns found : ' + campaignIterator.totalNumEntities()); while (campaignIterator.hasNext()) { let campaign = campaignIterator.next(); Logger.log(campaign.getName()); } } ``` |\n\n### I get a \"Cannot find function getFinalUrl\" error when upgrading my scripts\n\nYou may run into this error when changing your script to work with [Upgraded\nURLs](//support.google.com/google-ads/answer/6049217). This happens when you\nreplace calls to `ad.getDestinationUrl()` with `ad.getFinalUrl()`.\n`getFinalUrl()` is part of the\n[AdUrls](/google-ads/scripts/docs/reference/adsapp/adsapp_adurls) class,\nso you'd need to change your code to `ad.urls().getFinalUrl()`: \n\n function main() {\n // Incorrect snippet. getFinalUrl is not a member of the Ad class.\n let ad = AdsApp.ads().get().next();\n let url = ad.getFinalUrl();\n\n // Correct snippet.\n let ad = AdsApp.ads().get().next();\n let url = ad.urls().getFinalUrl();\n }\n\n### I get no stats for X\n\nUnavailability of data for a particular entity or date range is a common error\nyou may encounter when running reports or making stats calls. There are several\nthings that you can try:\n\n1. Check the date range for which you are retrieving stats or running reports.\n\n2. If you retrieve account-level stats for an Ads Manager script that manages\n accounts of different currencies, you get back the cost in the currency of\n the manager account.\n\n3. Google Ads may not have the data you are looking for yet. See our\n [data freshness guide](//support.google.com/google-ads/answer/2544985) for\n details.\n\n### How do I use feature X?\n\nSee our [code snippets](/google-ads/scripts/docs/examples) and\n[solutions](/google-ads/scripts/docs/solutions) for examples of how to\nuse a particular feature. If you don't find a suitable code snippet, feel free\nto make a request in the forum.\n\n### Still need support?\n\nIf you need assistance with an area where we can help, visit the\n[Get Help](/google-ads/scripts/docs/support/get-help) page."]]