Back to BlogAutomation

Track All Marketing Campaigns in One Google Sheets Dashboard

Stop logging into Facebook Ads, Google Ads, and LinkedIn just to check spend. Build a unified dashboard in Google Sheets that updates automatically.

December 26, 2025
3 min read

Your client wants to know "How much did we spend yesterday?" To answer that, you have to log into Facebook Business Manager, Google Ads, and LinkedIn Campaign Manager. By the time you answer, 15 minutes are gone.

You need one place that pulls from all of them.

The Setup

Configure your ad platforms to email CSV reports daily. Apps Script listens for those emails, pulls the data, normalizes it (Cost, Clicks, Impressions), appends it to a master sheet, and feeds a Looker Studio dashboard.

The Code: The Aggregator

1. Setup

  • Ad Platforms: Schedule a daily email report to your.email+reports@gmail.com. Format: CSV.
  • Gmail Label: Label these emails DAILY_REPORT.
  • Sheet: "Master Data" (Date, Platform, Campaign, Spend, Clicks, Impressions).

2. The Script

// CONFIGURATION
const LABEL_NAME = "DAILY_REPORT";
const SHEET_NAME = "Master Data";
 
function processDailyReports() {
  const label = GmailApp.getUserLabelByName(LABEL_NAME);
  const threads = label.getUnreadThreads();
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);
  
  threads.forEach(thread => {
    const messages = thread.getMessages();
    messages.forEach(message => {
      if (message.isUnread()) {
        const attachments = message.getAttachments();
        const subject = message.getSubject();
        
        // Identify Platform based on Subject Line
        let platform = "Unknown";
        if (subject.includes("Facebook")) platform = "Facebook";
        if (subject.includes("Google")) platform = "Google Ads";
        
        attachments.forEach(att => {
          if (att.getContentType() === "text/csv") {
            parseAndAppend(att, sheet, platform);
          }
        });
        
        message.markRead();
      }
    });
  });
}
 
function parseAndAppend(csvAttachment, sheet, platform) {
  const csvData = Utilities.parseCsv(csvAttachment.getDataAsString());
  
  // Assume CSV format: [Campaign, Spend, Clicks, Impr]
  // We need to map this to our Sheet: [Date, Platform, Campaign, Spend, Clicks, Impr]
  
  const today = new Date();
  
  // Skip Header (row 0)
  for (let i = 1; i < csvData.length; i++) {
    const row = csvData[i];
    // This mapping depends on the specific CSV export structure of each platform
    const campaign = row[0]; 
    const spend = row[1];
    const clicks = row[2];
    const impr = row[3];
    
    sheet.appendRow([today, platform, campaign, spend, clicks, impr]);
  }
}

Visualize It

Connect your "Master Data" sheet to Looker Studio (free).

  • Create a Time Series chart of "Spend by Platform".
  • Create a Scorecard for "Total Clicks".
  • Embed the report link back into your Google Sheet.

Why This Wins

Platform Agnostic. It doesn't matter if it's TikTok, Pinterest, or expensive programmatic ads. If it can send a CSV email, you can visualize it. Zero Cost. Supermetrics costs $200/month. This script costs $0.

Newsletter

Get more tips like this

Subscribe for practical Google Workspace automation tips.

Free updates. No spam. Unsubscribe any time.

Want more help?

We're here to help. Drop us an email and let's explore how we can optimize your workflows.

Email us

hello@mereth.dev

marketing automationcampaign trackingGoogle Sheets dashboardApps Scriptanalyticsreporting