External Data Integration
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
重要なデータ(在庫、コンバージョンなど)は、多くの場合、Google 広告のドメイン外に存在します。同様に、Google 広告の UI がデータ可視化に最適なツールであるとは限りません。Google 広告スクリプトを使用すると、外部データソースを簡単に統合できます。
Google スプレッドシート
Google スプレッドシート(Google ドライブにあります)は、機能が充実したウェブベースのスプレッドシート ソリューションです。Google 広告スクリプトでは、スプレッドシート サービスを使用してスプレッドシートの読み取りと書き込みを行うことができます。また、プログラムでスプレッドシートを作成し、データを入力して、フォントと色をフォーマットし、他のユーザーと共有することもできます。スクリプトでこれらの関数を使用する方法には、次のようなものがあります。
- レポートの可視化
- スプレッドシートでは、さまざまな種類のグラフを使用できます。グラフを含むスプレッドシートを設定してデータを可視化し、スクリプトからデータソースをインポートしてグラフを自動的に更新できます。
- データソース
- データを手動で入力する(または他のソースからデータを入力する)スプレッドシートを作成できます。スクリプトは、データを読み取って処理し、アカウントを更新できます。たとえば、スプレッドシートに新しいキーワードを入力すると、毎日実行されるスクリプトによってアカウントに追加されます。
- 中間的データ ストア
- スプレッドシートは、実行中に実行状態に関する情報を保存し、次の実行時に中断したところから再開できるようにします。たとえば、アカウント内のすべての広告グループを処理する必要があるが、30 分の実行時間制限を超える場合は、処理したものを記録できます。スクリプトが再度実行されると、スプレッドシートをチェックして開始位置を特定し、作業が重複しないようにします。
Google ドライブ
DriveApp
を使用すると、Google ドライブをさらに活用できます。これにより、スクリプトで Google ドライブ上の任意のファイルを作成、検索、変更できます。これは、前述のようにデータソースまたは中間データストアとして使用できます。
チャート
グラフ サービスでも、強化されたデータ可視化を利用できます。この本格的なグラフ作成サービスを使用すると、データ可視化のニーズを細かく制御できます。
JDBC
Google Cloud SQL、MySQL、Microsoft SQL Server、Oracle データベースなどの外部の JDBC 準拠データベースに接続できます。セットアップの手順については、こちらのガイドをご覧ください。
メール
Google 広告スクリプトでは、メールサービスを使用してメールを送信できます。メールは、スクリプトから必要な関連情報を自分に通知するために使用できます。たとえば、完全なレポートへのリンクを含む概要をメールで送信できます。カスタム HTML を使用してメール メッセージをカスタマイズしたり、画像を追加したりすることもできます。これにより、スクリプトからクライアントにプロフェッショナルなレポートを直接送信できます。添付ファイルを使用して、大きなレポートを送信できます。
URL 取得
Google 広告スクリプトでは、URL 取得サービスを使用して任意の URL のコンテンツを取得できます。この機能により、次のようなさまざまな機会が生まれます。
- 在庫情報をレポートするパスワード保護されたフィードをウェブサイトに設定します。次に、Google 広告スクリプトからアクセスして、アカウントの変更を適用します。
- 外部イベントに関する情報を取得し、その情報に基づいてアカウント管理の決定を行います。たとえば、HTTP ベースの API から天気情報を取得し、ターゲット地域で雨が降ったときに、入札単価を調整したり、広告を有効にしたりできます。
- ウェブ上にはさまざまな API が存在し、HTTP インターフェースを備えたものであればアクセスできます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-27 UTC。
[null,null,["最終更新日 2025-08-27 UTC。"],[[["\u003cp\u003eGoogle Ads Scripts facilitates integration with external data sources for enhanced data analysis and automation.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Sheets, Drive, and Charts services can be used for data visualization, storage, and reporting within Google Ads Scripts.\u003c/p\u003e\n"],["\u003cp\u003eExternal databases and custom web applications can be connected to Google Ads Scripts via JDBC and URL Fetching services.\u003c/p\u003e\n"],["\u003cp\u003eEmail functionality enables automated notifications and reporting based on script outputs.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Ads Scripts empowers users to programmatically control and automate Google Ads campaigns with external data and services.\u003c/p\u003e\n"]]],[],null,["# External Data Integration\n\nImportant data (inventory, conversions, etc.) often reside outside the Google\nAds domain. Likewise, the Google Ads UI may not always be the perfect\ntool for data visualization. Google Ads scripts provide an easy way to\nintegrate with external data sources.\n\nGoogle Spreadsheets\n-------------------\n\nGoogle Spreadsheets (found in [Google Drive](//drive.google.com)) are a\nfull-featured web-based spreadsheet solution. Google Ads scripts lets you read\nfrom and write to spreadsheets through the\n[Spreadsheet Service](/apps-script/reference/spreadsheet). You can also\nprogrammatically create a spreadsheet, populate it with data, format its fonts\nand colors, and share it with others. Some of the ways you can use them in your\nscripts include:\n\nReport visualization\n: Spreadsheets offer various types of charts. You can set up a spreadsheet with\n a chart to visualize your data, and then import the data source from a script to\n automatically update the chart.\n\nData source\n: You can create a spreadsheet where you manually input data (or input data\n from some other source). A script can then read and process the data to update\n your account. For example, you can enter new keywords to a spreadsheet that are\n then added to your account by a daily running script.\n\nIntermediate data store\n: A spreadsheet can store information about its execution state as it runs, so\n that it can pick up where it left off on the next execution. For example, if\n you need to process all ad groups in your account but it takes longer than the\n [30 minute execution time limit](/google-ads/scripts/docs/limits), you can\n record the ones you process as you go. When the script executes again, it can\n check the spreadsheet to figure out where to start so it doesn't duplicate any\n work.\n\nGoogle Drive\n------------\n\nYou can further leverage Google Drive with\n[`DriveApp`](/apps-script/reference/drive/drive-app) which lets scripts create,\nfind, and modify arbitrary files on Google Drive. This can be used as a data\nsource or intermediate datastore as previously shown.\n\nCharts\n------\n\nEnhanced data visualization is also available through the\n[Charts Service](/apps-script/reference/charts). This full-fledged chart\nbuilding service gives you extensive control over your data visualization\nneeds.\n\nJDBC\n----\n\nYou can connect to external JDBC-compliant databases such as Google Cloud SQL,\nMySQL, Microsoft SQL Server, and Oracle databases. See [this\nguide](/apps-script/guides/jdbc) for set-up instructions.\n\nEmail\n-----\n\nGoogle Ads scripts let you send out emails through the\n[Mail Service](/apps-script/reference/mail). Email can be used for\nnotifying yourself of any pertinent information you need from the script; for\nexample, mailing out a summary with a link to a full report. You can customize\nthe email message with custom HTML and even add images, allowing the script to\nsend professional-looking reports directly to your clients. Attachments can be\nused to send large reports.\n\nURL fetching\n------------\n\nGoogle Ads scripts let you fetch the content of an arbitrary URL using the\n[Url Fetch Service](/apps-script/reference/url-fetch). This feature opens\nup a range of opportunities:\n\n- Set up a password-protected feed on your website that reports inventory information. Then, access it through a Google Ads script in order to apply account changes.\n- Fetch information about external events and make account management decisions based on that information. For example, you could fetch weather information from an HTTP-based API and adjust bids or enable ads whenever it's raining in your target area.\n- There are a wide variety of APIs available across the web; anything that has an HTTP interface is accessible."]]