Back to Help

Detailed Setup Guide

Comprehensive instructions for setting up the MCC PMax script with troubleshooting tips and best practices.

Part 1: Before You Start

MCC Structure Requirements

The script must run in a Google Ads Manager Account (MCC). An MCC is a "manager" account that can access multiple Google Ads accounts from a single login.

  • You need Editor access to the MCC account
  • Client accounts can be directly under the MCC or in a hierarchy
  • The script will process all accounts the MCC can access

What the Script Does

  • Collects Performance Max, Shopping, and Demand Gen data from all accounts
  • Creates individual Google Sheets for each account with detailed insights
  • Updates data hourly on a schedule you define
  • Provides search terms, placements, assets, and performance metrics
Expected Time Investment: 5 minutes for initial setup, then fully automated. The script handles everything after you schedule hourly runs.

Part 2: Installation Steps

Step 1

Copy the Template Sheet

The template sheet is pre-configured with all the tabs and structure the script needs. You must create your own copy.

  1. Click: Make a copy of the template
  2. Rename your copy to something meaningful like: MCC PMax Data - [Your Company Name]
  3. Important: Keep the sheet in your Google Drive. The script needs access to it.
  4. Copy the complete URL from your browser's address bar. It should look like: https://docs.google.com/spreadsheets/d/1abc...xyz/edit
What's in the template: The template includes tabs for settings, totals, daily stats, weekly stats, trends, and a reference list of all accounts. These are all populated automatically by the script.
Step 2

Create the Script in Google Ads

  1. Log into your MCC account in Google Ads
  2. Navigate to: Tools & Settings → Bulk Actions → Scripts
  3. Click the + (New script) button
  4. In the script editor, name your script: MCC PMax Insights v92
  5. Get the script code from your purchase confirmation email
  6. Select all the default code in the editor and delete it
  7. Paste the MCC PMax script code
Can't find the code? Check your email for the purchase confirmation, or visit the scripts page if you're logged in.
Step 3

Add Your Sheet URL to the Script

  1. In the script editor, find line 39 (or search for "MASTER_SHEET_URL")
  2. You'll see:
    const MASTER_SHEET_URL = ''
  3. Paste your sheet URL between the single quotes:
    const MASTER_SHEET_URL = 'https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit'
  4. Important: Keep the single quotes. The URL must be between them.
  5. Click Save (or Ctrl+S / Cmd+S)
Step 4

Run the Script for the First Time

  1. Click the Run button (or Preview button, then Run)
  2. You'll be prompted to authorize the script:
    • Click Authorize
    • Select your Google account
    • Click Allow to grant permissions
  3. The script will start running. Watch the logs panel at the bottom.
  4. You should see:
    • "First-Time Run Detected"
    • "Populating the 'all' tab..."
    • "Auto-populating the 'settings' tab..."
    • "Processing first 3 accounts..."
  5. Wait time: ~1-2 minutes for setup, then ~10-15 minutes for the first 3 accounts
What's happening behind the scenes:
  • • The script fetches all accounts from your MCC
  • • It identifies which accounts have PMax campaigns with spend
  • • It auto-populates the settings tab with smart defaults
  • • It processes the first 3 accounts to give you immediate data

Part 3: Verify Setup

1. Check the 'all' Tab

Open your Google Sheet and go to the 'all' tab. You should see:

  • All accounts from your MCC listed with their names and IDs
  • Cost data for the last 30 days
  • Campaign counts for PMax, Shopping, and Demand Gen
  • Accounts sorted by total cost (highest first)

2. Check the 'settings' Tab

Go to the 'settings' tab. You should see:

  • Accounts with PMax spend automatically listed
  • Run times distributed (03, 04, 05, etc.)
  • Demand Gen column (G) auto-checked for accounts with DG campaigns
  • First 3 rows show TRUE in column O (Initialized)
  • Sheet URLs in column F for the first 3 accounts

3. Check Individual Account Sheets

Click one of the URLs in column F to open an individual account sheet. You should see:

  • Multiple tabs with data: PMax Overview, Search Terms, Placements, Assets, etc.
  • Real data from the account (not placeholder data)
  • Charts and visualizations (if the account has enough data)

Part 4: Schedule Hourly Runs

For the script to continue processing accounts and updating data, you need to schedule it to run every hour.

Creating the Trigger

  1. In the Google Ads script editor, click the Triggers icon (clock symbol) in the toolbar
  2. Click + Add Trigger
  3. Configure the trigger settings:
    Function to run:main
    Event source:Time-driven
    Type of time-based trigger:Hour timer
    Hour interval:Every hour
  4. Click Save
Best practice: The trigger will run at a random minute past the hour (e.g., 3:14am, 4:27am). This is by design from Google to distribute load. The script uses the hour (3, 4, 5) to determine which accounts to process, so the exact minute doesn't matter.

Part 5: Post-Setup Configuration (Optional)

Adjusting Run Times

The script distributes accounts across hours (03, 04, 05, etc.) with 15 accounts per hour. You can adjust this:

  1. 1. Open the settings tab in your sheet
  2. 2. Find the account you want to change
  3. 3. Update the number in column C (Run At)
  4. 4. The account will process during that hour on the next run

Setting Brand Terms

You can specify brand terms for each account to identify branded vs non-branded search terms:

  1. 1. In the settings tab, find column E (Brand Terms)
  2. 2. Enter brand terms as a comma-separated list: nike, swoosh, just do it
  3. 3. The script will flag search terms containing these words

Adding Accounts Manually

If an account wasn't auto-added (e.g., Shopping-only accounts), you can add it:

  1. 1. Find the account in the 'all' tab
  2. 2. Copy the Account ID and Name
  3. 3. Go to the settings tab
  4. 4. Paste into a new row at the bottom
  5. 5. Set the Run At time (column C)
  6. 6. Set Initialized to FALSE (column O)
  7. 7. The account will process on the next hourly run

Common Setup Issues

"No MASTER_SHEET_URL found" error

This means you haven't added your sheet URL to line 39 of the script.

Fix: Go back to Step 3 and make sure you've pasted your sheet URL between the single quotes.

Script can't access my sheet

The script needs permission to access your Google Sheet.

Fix: Make sure you created your own copy of the template (don't use someone else's sheet). Check that the sheet is in your Google Drive and you haven't restricted sharing.

'Settings' tab shows no accounts

This means none of your accounts have PMax spend in the last 30 days.

Fix: Check the 'all' tab to see which accounts have data. You can manually add accounts from the 'all' tab to the 'settings' tab following the format.