Frequently asked questions

I set the automatic run time (frequency) of the Yahoo! JAPAN Ads script at 12 AM every day, but it runs about five minutes later. Why?
The run time isn't exact.

Even though I specified the city/town/village name, I can't get weather data. Why?
Check if the specified city/town/village is a "prefecture name (half-width space) city name."
*Specify location names in Japanese.

I received the following error when running the script:
"Exceeded maximum execution time"

The processing time limit is 10 minutes.
If the process takes longer than 10 minutes, an error occurs, and the script ends.

I received the following error when running the script:
"Exceeded maximum log length"

There is a 100 KB limit for script logging output (*) that you can specify.
If the logging output exceeds the limit, you will receive this error. The script runs to the end without stopping it.
*100 KB=51200 characters
→A line with 50 characters is about 1024 lines of data.
*Example description in the script:
Logger.log('Log output contents') ;

I pasted the "sample program" from Yahoo! JAPAN Ads Script, but I got the following error. Why?
"ReferenceError: main is not defined"

This error occurs when the script doesn't have the main function.
Yahoo! JAPAN Ads Script won't run without a main function in common with JavaScript.
From the main functions in the sample scripts, call the one you want to use.
Example: When using the "Create an account report" in this page

function main(){
  createAccountReport();
}
function createAccountReport(){ const accountId = AdsUtilities.getCurrentAccountId(); const startDate = yyyyMMdd;//Write the date in yyyyMMdd format const endDate = yyyyMMdd; const report = AdsUtilities.getSearchReport({ accountId: accountId, dateRange: { endDate: endDate, startDate: startDate, }, fields: ['ACCOUNT_ID', 'IMPS', 'CLICKS', 'COST'], reportDateRangeType: 'CUSTOM_DATE', reportType: 'ACCOUNT', }).reports[0].rows; for (let i = 0; i < report.length; i++){ Logger.log('ACCOUNT_ID-> ' + report[i][0] + ', IMPS-> ' + report[i][1] + ', CLICKS-> ' + report[i][2] + ', COST-> ' + report[i][3]); } }

What duration of weather forecast data can Yahoo! JAPAN Ads Script use?
The day (TODAY) and the following day (TOMORROW).
To get both days, specify (TODAY_AND_TOMORROW).

Learn more about functions in the reference.
https://ads-developers.yahoo.co.jp/en/ads-script/product-guide/reference/interfaces/WeatherApp-1.html

What units of the area can I specify in the weather forecast data?
You can specify "Prefecture" or "Administrative district."
*When you specify a prefecture, the prefectural capital will be a target location.
*Regions, primary subdivisions and county designations aren't available.
Example
When specifying the prefecture: Specify "東京都" (Tokyo)
*Specify location names in Japanese.
When specifying the administrative district: Specify "東京都 港区" (Tokyo Minato).
*A space between Tokyo and Minato.
*Specify location names in Japanese.

Learn more about functions in the reference.
https://ads-developers.yahoo.co.jp/en/ads-script/product-guide/reference/interfaces/WeatherApp-1.html

Where can I find the spreadsheet ID to process the Google Sheets in Yahoo!JAPAN Ads Script?
The spreadsheet ID appears in the spreadsheet URL (See the red part).
https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxx/edit#gid=0
Specify this character string as a spreadsheet ID in Yahoo! JAPAN Ads Script.

Reference: Google Sheets API Overview (Google Sheets for Developers)
https://developers.google.com/sheets/api/guides/concepts(2022-11-02)

When I download or upload 20 MB (the upper limit of Yahoo! JAPAN Ads Script) files multiple times, I get an error. Why?
If you request files close to 20 MB multiple times, an error may occur. To request multiple times, use a file of around 5 MB.