このチュートリアルでは、MCC配下の全アカウントのコンバージョンゴールアクティビティを監査するスクリプトについて説明します。結果をGoogleシートに書き出し、各ゴールの健全性をタグ付けし、ステータスを色分けし、問題がある場合のみサマリーをメールで送信します。
不必要なツールやサードパーティのダッシュボードはなく、生のコントロールと完全な可視性だけだ。
このスクリプトは、あなたのMCCの下にあるすべてのGoogle Adsアカウントを監査し、定義されたルックバック期間にわたって各コンバージョンゴールのステータスを評価します。どのゴールがアクティブか、または壊れているかを推測する代わりに、このシステムはGoogleシートでリアルタイムのスナップショットを提供し、注意が必要な場合にのみ警告を発します。
There will be two email notifications: one for accounts needing attention and the other for all good accounts.
例
メッセージ
Got it, your script needs two distinct email outputs:
✅"All Good "Eメール(問題が見つからなかった場合)
⚠️ "Needs Attention"(要注意)Eメール(活動休止、欠落、低パフォーマンスの目標がある場合
あなたのサンプルデータと現在のロジックを使って、両方のバージョンがどのように見えるべきかを正確に示します:
メッセージ#1
モニターされているすべてのコンバージョン目標は、過去60日間の活動を報告しています。
どの口座でも問題は見つかっていない。
レポート全文を見る
https://docs.google.com/spreadsheets/d/yoursheetid
メッセージ #2
以下のコンバージョン目標は見直しが必要かもしれない(例:最近コンバージョンしていない、活動休止中):
Bright Widgets Inc (123-456-789) - 問い合わせフォームの送信 (要注意)
Acme Corp (987-654-321) - スケジュールコール (休止中)
Acme Corp (987-654-321) - 無料トライアル登録 (要注意)
Rocket Leads (456-789-123) - (設定済み、活動なし) (最近のコンバージョンなし)
Beta Test Group (321-654-987) - (未設定) (非アクティブ)
Zebra Analytics (999-111-222) - ホワイトペーパーダウンロード (要注意)
レポート全文を見る
https://docs.google.com/spreadsheets/d/yoursheetid
スクリプトをデプロイする前に、お使いの環境が正しく設定されていることを確認してください。このスクリプトは、Google Ads MCC コンテキスト内で実行し、データを書き込んでアラートを送信するように設計されています。
これはスクリプトの完全な未編集版です。すべてのコメント、書式、ロジックは最初に書かれたとおりです。このチュートリアルで後述する内訳に従うつもりなら、これを修正しないでください。
// ========== CONFIGURATION ========== const SHEET_ID = '1PvpW3eUl5fqRwabBg0P7D8LKzW83MOTVX1KDBMB3ipA'; const LOOKBACK_DAYS = 60; const EXCLUDED_ACCOUNT_IDS = [ '000-000-000', '000-000-000', '000-000-000' ]; const RECIPIENT_EMAILS = '[email protected]'; // =================================== function main() { const sheet = SpreadsheetApp.openById(SHEET_ID).getSheets()[0]; sheet.clear(); sheet.appendRow(['Account Name', 'Account ID', 'Goal Name', 'Conversions', 'Status', 'Date Range']); const startDate = getDateXDaysAgo(LOOKBACK_DAYS); const endDate = getTodayDate(); const dateRangeLabel = `Last ${LOOKBACK_DAYS} days (${startDate} to ${endDate})`; const accounts = MccApp.accounts().get(); const flagged = []; let rowIndex = 2; while (accounts.hasNext()) { const account = accounts.next(); const accountId = account.getCustomerId(); const accountName = account.getName(); Logger.log(`⏳ Checking account: ${accountName} (${accountId})`); if (EXCLUDED_ACCOUNT_IDS.includes(accountId)) { Logger.log(`🚫 Skipping excluded account: ${accountName} (${accountId})`); continue; } try { MccApp.select(account); const query = ` SELECT ConversionTypeName, Conversions FROM CAMPAIGN_PERFORMANCE_REPORT DURING ${startDate},${endDate} `; const report = AdsApp.report(query); const rows = report.rows(); const goalMap = {}; while (rows.hasNext()) { const row = rows.next(); const goalName = row['ConversionTypeName'] || '(not set)'; const conversions = parseFloat(row['Conversions']) || 0; if (!goalMap[goalName]) { goalMap[goalName] = 0; } goalMap[goalName] += conversions; } if (Object.keys(goalMap).length === 0) { Logger.log(`⚠️ No conversion data returned for account: ${accountName} (${accountId})`); const status = 'No Recent Conversions'; sheet.appendRow([ accountName, accountId, '(configured, no activity)', 0, status, dateRangeLabel ]); setStatusColumnColor(sheet, rowIndex, status); flagged.push(`${accountName} (${accountId}) - no conversion goals triggered`); rowIndex++; continue; } for (const [goalName, totalConversions] of Object.entries(goalMap)) { let status; if (totalConversions > 0) { status = 'Active'; } else if (goalName.toLowerCase().includes('test') || goalName === '(not set)') { status = 'Inactive'; } else { status = 'Needs Attention'; } sheet.appendRow([ accountName, accountId, goalName, totalConversions, status, dateRangeLabel ]); setStatusColumnColor(sheet, rowIndex, status); if (status !== 'Active') { flagged.push(`${accountName} (${accountId}) - ${goalName} (${status})`); } rowIndex++; } } catch (e) { Logger.log(`❌ Error processing account: ${accountName} (${accountId}) - ${e.message}`); } } if (flagged.length > 0) { const subject = '⚠️ Conversion Goals Needing Attention'; const body = `The following conversion goals may need review (e.g., no recent conversions or inactive):\n\n` + flagged.join('\n') + `\n\nView the full report:\nhttps://docs.google.com/spreadsheets/d/${SHEET_ID}`; MailApp.sendEmail(RECIPIENT_EMAILS, subject, body); } else { Logger.log('✅ All goals are reporting conversions.'); } } // 🎨 Apply color to only the "Status" column (Column E) function setStatusColumnColor(sheet, row, status) { const range = sheet.getRange(row, 5); // Column E switch (status) { case 'Active': range.setBackground('#d9ead3'); // Light green break; case 'Inactive': range.setBackground('#f4cccc'); // Light red break; case 'Needs Attention': range.setBackground('#fff2cc'); // Light yellow break; case 'No Recent Conversions': range.setBackground('#e6e6fa'); // Light purple break; default: range.setBackground(null); } } // 🕒 Helpers function getTodayDate() { const date = new Date(); return Utilities.formatDate(date, AdsApp.currentAccount().getTimeZone(), 'yyyyMMdd'); } function getDateXDaysAgo(days) { const date = new Date(); date.setDate(date.getDate() - days); return Utilities.formatDate(date, AdsApp.currentAccount().getTimeZone(), 'yyyyMMdd'); }
This walkthrough shows how to set up the conversion goal health checker for your Google Ads MCC account. Follow each step to get the system running, write to Google Sheets, and send alerts when something breaks.
出力先の設定から始める。
このスクリプトをMCCアカウントにデプロイします。
スクリプトを初めて使用するときは、認証が必要です。
このステップを完了しないと、スクリプトの実行に失敗します。
スクリプトの内部で、以下の内容を確認し、修正する:
スクリプトの残りはそのままでいい。
手動で一度実行し、すべてがうまくいくことを確認する。
これを自動化するには、定期的なスケジュールで実行するように設定する。
スクリプトは自動的に実行され、何かがオフのときだけ警告を発する。
スクリプトが実行されると、すべてのコンバージョンゴールをチェックします。非アクティブまたは未発火のものがあれば、Eメールを受け取ります。
このスクリプトは単なるデータダンプではありません。Google Ads MCC全体のあらゆるコンバージョン目標の監視役です。何かが壊れたり、止まったり、トラッキングが静かに止まったりするとアラートが表示されます。何も問題がないときは、沈黙が訪れます。
管理するすべてのアカウントをチェックし、アクティブでない目標やパフォーマンスの低い目標にフラグを立て、フィルタリングされたノイズのないレポートを受信トレイに直接送信します。Googleシートは、アカウント、ゴール名、コンバージョンボリュームごとにゴールステータスをライブ表示します。
インターフェイスを調べたりはしない。月末まで待って盲点に気づくこともない。問題になる前にコントロールできる。
同様の記事をチェックする
同様の記事をチェックする
If you manage multiple accounts, don’t miss our guide on tracking GA4 issues from numerous properties or exporting top-performing actual search terms with a lightweight script to refine your targeting.
トラッキングが機能しているかどうかを推測することにうんざりしていませんか?単なる報告書ではなく、システムを構築するチームをお望みですか?
Bright Vessel doesn’t just manage Google Ads; we engineer performance visibility at scale. Whether you need help deploying this script, integrating it into a larger automation stack, or building a custom analytics layer that tells you something, we’re ready.
他の代理店が偽造しているものを作っているチームと話す。
「は必須項目
「は必須項目
「は必須項目