Slack
    
    
      
    
    
      
      컬렉션을 사용해 정리하기
    
    
      
      내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
사용자 또는 그룹에게 메시지 게시
/**
 * An example of sending messages into Slack. See:
 * https://developers.google.com/google-ads/scripts/docs/features/third-party-apis
 *
 * Webhook set up at: https://api.slack.com/custom-integrations >
 * 'Set up an incoming webhook', follow the steps then click 'Add Incoming
 * WebHooks Integration'. This will create the URL needed for below, e.g:
 * 'https://hooks.slack.com/services/TXXXXXXX/BXXXXXXX/AAAAAAAAABBBBBBBBBBCCCC';
 */
const SLACK_URL = 'INSERT_WEBHOOK_URL_HERE';
// An example of retrieving an Google Ads Report and sending it in a slack message.
function sendReportToSlack() {
  const report = AdsApp.report(
      'SELECT CampaignName, Impressions, Clicks FROM ' +
      'CAMPAIGN_PERFORMANCE_REPORT DURING YESTERDAY');
  const spreadsheet = SpreadsheetApp.create('Report');
  report.exportToSheet(spreadsheet.getActiveSheet());
  // See https://api.slack.com/docs/message-formatting for message formatting.
  const message = 'Your *Google Ads Report* is ready! <' + spreadsheet.getUrl() +
      '|Click here>';
  sendSlackMessage(message);
}
/**
 * Sends a message to Slack
 * @param {string} text The message to send in slack formatting. See:
 *     https://api.slack.com/docs/message-formatting.
 * @param {string=} opt_channel An optional channel, which can be channel e.g.
 *     '#google-ads' or a direct message e.g. '@sundar'. Defaults to '#general'.
 */
function sendSlackMessage(text, opt_channel) {
  const slackMessage = {
    text: text,
    icon_url:
        'https://www.gstatic.com/images/icons/material/product/1x/adwords_64dp.png',
    username: 'Google Ads Scripts',
    channel: opt_channel || '#general'
  };
  const options = {
    method: 'POST',
    contentType: 'application/json',
    payload: JSON.stringify(slackMessage)
  };
  UrlFetchApp.fetch(SLACK_URL, options);
}
  
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
  최종 업데이트: 2025-08-21(UTC)
  
  
  
    
      [null,null,["최종 업데이트: 2025-08-21(UTC)"],[],[]]