See llms.txt for all machine-readable content.

Back to Templates

Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets

Created by

Created by: Robert Breen || rbreen
Robert Breen

Last update

Last update 5 months ago

Categories

Share


This workflow transforms raw marketing data from Google Sheets into a pivot-like summary table. It merges lookup data, groups spend by name, and appends the results into a clean reporting tab โ€” all automatically, without needing to manually build pivot tables in Sheets.


๐Ÿง‘โ€๐Ÿ’ป Whoโ€™s it for

  • Marketing analysts who track channel spend across campaigns
  • Small businesses that rely on Google Sheets for reporting
  • Teams that need automated daily rollups without rebuilding pivot tables manually

โš™๏ธ How it works

  1. Get Marketing Data (Google Sheets) โ€“ Pulls raw spend data.
  2. Vlookup Data (Google Sheets) โ€“ Brings in reference/lookup fields (e.g., channel labels).
  3. Merge Tables โ€“ Joins marketing data and lookup data on the Channel column.
  4. Summarize โ€“ Groups data by Name and sums up Spend ($).
  5. Clear Sheet โ€“ Wipes the reporting tab to avoid duplicates.
  6. Append to Pivot Sheet โ€“ Writes the aggregated results into the "render pivot" sheet.

The result: a pivot-style summary table inside Google Sheets, automatically refreshed by n8n.


๐Ÿ”‘ Setup Instructions

1) Connect Google Sheets (OAuth2)

  1. In n8n โ†’ Credentials โ†’ New โ†’ Google Sheets (OAuth2)
  2. Sign in with your Google account and grant access
  3. In each Google Sheets node, select your Spreadsheet and the appropriate Worksheet:
    • data (raw spend)
    • Lookup (channel reference table)
    • render pivot (output tab)

2) Configure Summarize Node

  • Group by: Name
  • Summarize: Spend ($) โ†’ sum

3) Test the Workflow

  1. Execute the workflow manually
  2. Check your "render pivot" tab โ€” it should display aggregated spend by Name

๐Ÿ› ๏ธ How to customize

  • Change grouping fields (e.g., by Channel, Campaign, or Region)
  • Add more aggregations (e.g., average CPC, max impressions)
  • Use the Merge node to join extra data sources before summarizing
  • Schedule execution to run daily for fresh rollups

๐Ÿ“‹ Requirements

  • n8n (Cloud or self-hosted)
  • Google Sheets account with structured data in data and Lookup tabs

๐Ÿ“ฌ Contact

Need help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your pivot)?