ログエラーの解決に関しまして

172 views
Skip to first unread message

ryo sato

unread,
Mar 14, 2024, 10:43:38 PM3/14/24
to Google Ads Scripts Forum
お世話になります。
下記スクリプトを組み、実行したところ添付ファイルのようなエラーが発生いたしました。
解決の方法を教示いただきたく、よろしくお願いいたします。


function main() {
  var spreadsheet = SpreadsheetApp.openById('1OT4QnhxA7g5eCNx8j-AveJQNugWMeDPKB3HntvX-pRM');
  var sheet = spreadsheet.getSheetByName('当月予算進捗');
  var lastRow = sheet.getLastRow();
  if (lastRow == 6) {
    Logger.log('スプレッドシートにキャンペーンが存在しません');
    return;
  }
  var range = sheet.getRange(7, 2, lastRow-6, 9).getValues();

  for (let i = 0; i < lastRow-6; i++) {
    var campaignName = range[i][2];
    var amount = range[i][7];
    const campaignIterator = AdsApp.campaigns()
          .withCondition(`campaign.name = "${campaignName}"`)
          .get();
    if (!campaignIterator.hasNext()) {
      throw new Error(` "${campaignName}"は存在しません`);
    }
    const campaign = campaignIterator.next();
    campaign.getBudget().setAmount(amount);
  }

}
名称未設定のデザイン.pdf

Google Ads Scripts Forum

unread,
Mar 15, 2024, 5:09:07 AM3/15/24
to Google Ads Scripts Forum

こんにちは、


Google 広告 Scripts サポート チームにお問い合わせいただきありがとうございます。


この製品の公式サポートは英語のみであることをお知らせします。 できれば英語で返信していただけると助かります。 そうでない場合は、Google 翻訳を使用して可能な限りサポートします。


スクリプトを確認したところ、「例外: 要求されたドキュメントにアクセスする権限がありません」というエラー メッセージが表示されたことをお知らせいたします。 シートへのアクセス権を提供してください。このガイドに従ってファイルを公開して共有できます。 ファイルを公に共有することが難しい場合は、同じスレッドにダウンロード コピーをアップロードしてください。 これに加えて、問題を再現できるスクリプト スニペットを共有します。


要求された詳細は、作成者に非公開で返信するオプション、またはこのメールに直接非公開で返信することで共有できます。


よろしく

Google 広告スクリプトのサポート チーム。



Original Message:


Hi,


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


I would like to inform you that this product officially offers support in only English. It would be best to reply in English if you can. If not, we will try to use Google Translate to support you as best as we can.


By reviewing your script, I would like to inform you that we have received an error message “Exception: You do not have permission to access the requested document”. Please provide us with access to the sheet and you can follow this guide to share a file publicly. If you are facing difficulties to share the file publicly, upload a download copy in the same thread. In addition to this, share a script snippet that can reproduce the issue.


You can share the requested details via Reply privately to the author option or a direct private reply to this email.


Regards,

Google Ads Scripts support team.

ryo sato

unread,
Mar 18, 2024, 4:47:17 AM3/18/24
to Google Ads Scripts Forum
Thank you for your information. I have written the URL of the script below, could you please check it? https://docs.google.com/document/d/1ArDoPtVWWEnXnE09iKCvm6r81V2UTB_YyNbnO-LgLRw/edit?usp=sharing If you run this script within an advertising account, an error will occur. I would appreciate it if you could tell me how to solve it.

2024年3月15日金曜日 18:09:07 UTC+9 Google Ads Scripts Forum:

Google Ads Scripts Forum Advisor

unread,
Mar 18, 2024, 9:59:08 AM3/18/24
to adwords...@googlegroups.com

Hi,

Thank you for getting back to us.

Upon previewing the script that you have provided, it appears that we didn't receive any errors on our side. Could you please try running the script again on your end? If the issue still persists, kindly provide us with the following details for further investigation of the issue:

  • Google Ads account ID or CID
  • Name of the affected script

Also, please be informed that we do not have access to the document that you have provided. Please follow the below steps to share a file publicly:

  • Select the file you want to share.
  • Click Share.
  • Under “General access” click the Down arrow .
  • Choose Anyone with the link.
  • To decide what role people will have, select Editor.
  • Click the Copy link.
  • Click Done.
  • Paste the link in an email or any place you want to share it.

If you are facing difficulties to share the file publicly, upload a download copy in the same thread.

You can share the requested details via Reply privately to the author option or a direct private reply to this email.

This message is in relation to case "ref:!00D1U01174p.!5004Q02s00wP:ref" (ADR-00227629)

Thanks,
 
Google Logo Google Ads Scripts Team
 

 



Reply all
Reply to author
Forward
0 new messages