Deze tutorial beschrijft een script dat de conversiedoelactiviteit in alle accounts onder uw Mijn Klantencentrum controleert. Het schrijft de resultaten naar een Google Spreadsheet, labelt de status van elk doel, geeft de status een kleurcode en verstuurt alleen een samenvatting per e-mail wanneer er een probleem is.
Er zijn geen onnodige hulpmiddelen of dashboards van derden; alleen pure controle en volledige zichtbaarheid.
This script audits every Google Ads account under your MCC and evaluates the status of each conversion goal over a defined lookback period. Instead of guessing which goals are active or broken, this system gives you a real-time snapshot in a Google Sheet and only alerts you when something needs your attention.
Er zijn twee e-mailmeldingen: één voor accounts die aandacht nodig hebben en de andere voor alle geldige accounts.
Example:
Messages:
Got it, your script needs two distinct email outputs:
✅ “All Good” Email (if no issues are found)
⚠️ “Needs Attention” Email (if any goals are inactive, missing, or low-performing)
Here’s precisely how both versions should look, using your sample data and current logic:
Message #1
All monitored conversion goals are reporting activity over the last 60 days.
Er zijn geen problemen gevonden in accounts.
View the full report:
https://docs.google.com/spreadsheets/d/yoursheetid
Message #2
The following conversion goals may need review (e.g., no recent conversions or inactive):
Bright Widgets Inc (123-456-789) - Contact Form Submission (Needs Attention)
Acme Corp (987-654-321) - Schedule Call (Inactive)
Acme Corp (987-654-321) - Free Trial Signup (Needs Attention)
Rocket Leads (456-789-123) - (configured, no activity) (No Recent Conversions)
Beta Test Group (321-654-987) - (not set) (Inactive)
Zebra Analytics (999-111-222) - Whitepaper Download (Needs Attention)
View the full report:
https://docs.google.com/spreadsheets/d/yoursheetid
Before deploying the script, make sure your environment is configured correctly. This script is designed to run within a Google Ads MCC context to write data and send alerts.
Dit is het script in zijn volledige, onbewerkte vorm. Alle opmerkingen, opmaak en logica zijn exact zoals oorspronkelijk geschreven. Wijzig dit niet als u van plan bent de indeling later in deze tutorial te volgen.
// ========== 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'); }
Deze walkthrough laat zien hoe u de statuschecker voor conversiedoelen instelt voor uw Google Ads MCC-account. Volg elke stap om het systeem te laten werken, schrijf naar Google Spreadsheets en verstuur meldingen wanneer er iets misgaat.
Begin met het instellen van de uitvoerbestemming.
U implementeert dit script in uw MCC-account.
De eerste keer dat u het script gebruikt, moet u het autoriseren.
U moet deze stap voltooien, anders mislukt de uitvoering van het script.
Bekijk en wijzig het volgende in het script:
De rest van het script kunt u precies zo laten als het is.
Voer het handmatig een keer uit om te controleren of alles werkt.
Als u dit automatisch wilt laten verlopen, stelt u in dat dit volgens een terugkerend schema moet gebeuren.
Het script wordt automatisch uitgevoerd en waarschuwt u alleen als er iets niet klopt.
When the script runs, it checks all conversion goals. If any are inactive or not firing, you receive an email.
Dit script is niet zomaar een datadump. Het is een waakhond voor elk conversiedoel in uw volledige Google Ads MCC. U ontvangt een melding wanneer iets niet werkt, vastloopt of stilletjes stopt met meten. Als alles in orde is, krijgt u stilte.
It checks every account you manage, flags inactive or underperforming goals, and delivers a filtered, no-noise report straight to your inbox. The Google Sheet gives you a live view of goal status by account, goal name, and conversion volume, with visual cues baked in.
You’re not digging through interfaces. You’re not waiting until the end of the month to realize you’ve been blind. You’re in control before it becomes a problem.
Check out similar posts:
Check out similar posts:
If U beheert meerdere accounts, Mis onze gids niet over het volgen van GA4-problemen van talrijke eigendommen of exporteren Best presterende werkelijke zoektermen met een lichtgewicht script to refine your targeting.
Bent u het zat om te gissen of uw tracking werkt? Wilt u een team dat systemen bouwt in plaats van alleen rapporten?
Bright Vessel beheert niet alleen Google Ads; wij ontwikkelen prestatiezichtbaarheid op schaal. Of u nu hulp nodig heeft bij het implementeren van dit script, het integreren ervan in een grotere automatiseringsstack of het bouwen van een aangepaste analyselaag die u iets vertelt, wij staan voor u klaar.
Talk to the team that builds what other agencies fake.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields