Engineering Toolkit · Google Ads Script

Performance Max Brand Cannibalisation & Search Theme Auditor

Google conceals granular search queries inside Performance Max. By default, the algorithm frequently bids aggressively on your existing brand terms, inflating cosmetic ROAS while cannibalising traffic that would have converted for free organically.

Unlock & Download Script (.js) ↓Run 3-Min Diagnostic →

What this script does

  • Queries Google’s campaign_search_term_insight resource across all active PMax campaigns via GAQL.
  • Classifies search term categories against your brand and competitor tokens.
  • Calculates your Brand Click Share and Brand Conversion Value Share in PMax.
  • Automatically generates a formatted Google Sheet with an executive risk summary and exclusion tokens.
  • Requires zero external software or paid subscriptions — runs 100% inside your Google Ads account scripts.
Google Ads Script (V8 Engine) · Locked PreviewLast updated: 2026
/**
 * Murtaza Rangwala — Senior Google Ads Consultant (murtazarangwala.com)
 * Tool: PMax Brand Cannibalisation & Search Theme Auditor (v2.4)
 * Compatibility: Modern Google Ads Scripts (V8 Engine)
 */

const CONFIG = {
  SPREADSHEET_URL: '', // Leave empty to auto-create a new Google Sheet
  BRAND_TERMS: ['yourbrand', 'brandname'], // Add lowercase brand tokens
  COMPETITOR_TERMS: ['competitora', 'competitorb'],
  DATE_RANGE: 'LAST_30_DAYS',
  MIN_CLICKS: 5,
  ALERT_EMAIL: '' // Optional notification email
};

function main() {
  Logger.log('Starting PMax Brand Cannibalisation Audit...');
  const ss = getOrCreateSpreadsheet(CONFIG.SPREADSHEET_URL);
🔒 +145 lines of GAQL & Sheets automation locked
Instant Script Access

Unlock & download the full Google Ads Script (.js)

Enter your details below to unlock the complete copy-paste script on screen and start the .js file download immediately.

Instant download & on-screen code reveal. Your details stay with me — never sold or shared. Privacy policy.

How to install in 2 minutes

  1. Log in to your Google Ads account.
  2. Navigate to Tools & Settings → Bulk Actions → Scripts.
  3. Click the blue + (New Script) button.
  4. Paste the script code into the editor, replacing existing template code.
  5. Update CONFIG.BRAND_TERMS with your brand name tokens in lowercase.
  6. Click Authorize to grant the script permission to query insights and create a Google Sheet.
  7. Click Preview or Run, then check the logs for your generated Google Sheet URL.
Companion Methodology

The Conversion Lag & Real tROAS Calibrator

PMax cannibalisation is only one half of algorithmic distortion. The other is Conversion Lag. If your sales cycle takes 7 to 30 days, your recent 7-day ROAS in Google Ads is mathematically deflated. Marketers who lower bids on lagging campaigns choke off profitable impression volume.

The Lag Multiplier Formula:Calibrated ROAS = Reported Value / (Cost × Cohort Maturity Factor)

Rule of thumb: never adjust Target ROAS or Target CPA on data inside your 85% maturity window. For high-ticket eCommerce, that means evaluating bid performance on 30-day trailing cohorts, not yesterday’s numbers.

Want me to audit your account structure personally?

Get a comprehensive 30+ point teardown of your Google Ads account, including broad match leakage, conversion-tracking gaps, and a prioritised 90-day action plan. Delivered as a custom 15–25 min Loom.

Request Free Loom Teardown →Book a 30-Min Call