PMax & Search Cannibalization: Custom GAQL Script Guide

Learn how to build and deploy a custom GAQL script to detect query cannibalization between Performance Max and Search campaigns to eliminate wasted spend.

By AdTurbo Team · 2026-10-13

Performance Max (PMax) has fundamentally changed how Google Ads allocates ad spend across networks. While Google promotes PMax as a holistic, multi-channel performance driver, paid search practitioners frequently encounter a costly operational side effect: internal query cannibalization. Without strict parameters, PMax campaigns frequently enter Search auctions where your dedicated Standard Search campaigns are already competing, bidding against your own keywords, skewing ROAS metrics, and driving up your average Cost Per Click (CPC).

Standard reporting in the Google Ads user interface obscures this overlap. To uncover exactly where PMax is siphoning impressions and clicks away from your dedicated Search campaigns, you need programmatic visibility. In this guide, we will walk through the exact mechanics of internal query competition and build a custom GAQL script for PMax and Search cannibalization to extract, cross-reference, and audit cross-campaign query overlap directly inside your account.

The Mechanics of PMax vs. Search Cannibalization in Google Ads

To detect and resolve cannibalization, you must first understand the deterministic rules Google uses to resolve internal auction competition between Performance Max and Search campaigns.

How Google Ads Resolves the PMax vs. Search Auction

Google claims that Standard Search campaigns generally take priority over Performance Max, but that statement comes with critical caveats that often catch advertisers off guard:

1. Exact Match Search Keywords: If a user's search query matches an active Exact match keyword identically (including normalized spellings and close variants), Google will prioritize your Standard Search campaign over Performance Max. However, if that Exact match keyword is budget-constrained, limited by bid adjustments, or restricted by geo-targeting, PMax can and will step into the auction.

2. Phrase and Broad Match Keywords: When a user's query triggers a Phrase or Broad match keyword in your Search campaign, Google uses Ad Rank to decide whether your Search campaign or your Performance Max campaign enters the auction. If PMax boasts a higher predicted click-through rate (pCTR), more relevant ad components, or a higher effective Max CPC calculation determined by Smart Bidding, PMax wins the right to enter the ad auction instead of your dedicated Search ad.

3. Search Themes and Asset Groups: Search Themes in PMax act as directional signals, not restrictive keywords. PMax uses them to expand into wide topical clusters, frequently outbidding Broad and Phrase match keywords in existing Search ad groups.

The Paid Media Paradox: High ROAS, Flat Revenue

Query cannibalization creates an account-level illusion. PMax often targets bottom-of-funnel branded search terms or high-intent commercial keywords that your Search campaigns already capture efficiently. Because these high-converting queries carry high conversion probabilities, PMax records an impressive in-platform ROAS.

However, top-line business revenue remains completely flat. PMax has not uncovered incremental volume; it has merely claimed credit for existing search demand at a higher combined marginal cost. The user would have converted on your lower-cost Search ad, but PMax intervened. Identifying this behavior requires digging past high-level summary cards into granular query-level data.

Why Native Reporting Fails to Expose Cross-Campaign Overlap

Diagnosing cannibalization through the standard Google Ads web console is notoriously difficult due to deliberate reporting limitations built into Performance Max.

Search Themes Are Not Queries

Advertisers often confuse Search Themes with actual search queries. Adding a Search Theme to a PMax asset group merely indicates an intent category to Google's machine learning models. It does not provide an audit trail of the actual user queries matched by the algorithm. When reviewing asset group metrics, you cannot see the exact queries matched to those themes in the primary interface table.

Incomplete Search Terms Reporting

While Google added the "Search Terms Insight" report to Performance Max, it groups user searches into abstracted consumer intent categories. Under standard campaign views, you cannot run a side-by-side vlookup of query-level impressions between Search and PMax. Furthermore, privacy thresholds redact a substantial percentage of search terms that fall below minimum search volume thresholds.

To conduct an accurate audit, you cannot rely on manual UI exports. You need direct programmatic access via the Google Ads Query Language (GAQL) and Google Ads Scripts to inspect auction-level touchpoints and match patterns across your entire campaign portfolio.

Understanding GAQL Resources for Query Overlap

Google Ads Query Language (GAQL) queries the Google Ads API using an SQL-like syntax. To detect cannibalization, we must bridge the reporting gap between standard search term reports and Performance Max insights.

Relevant API Resources and Views

When writing a detect pmax search overlap script, we interact primarily with two distinct API resources:

• searchtermview: The historical query repository for Standard Search and Shopping campaigns. It provides exact metrics (metrics.impressions, metrics.clicks, metrics.costmicros, metrics.conversions) mapped to segments.searchterm and campaign.id.

• campaignsearchterminsight: The reporting resource that exposes query clusters and search categories for both Search and Performance Max campaigns. It maps performance metrics to campaignsearchterminsight.categorylabel.

• campaign: Provides metadata such as campaign.advertisingchanneltype (which distinguishes SEARCH from PERFORMANCEMAX), campaign status, and budget allocations.

Why searchtermview Alone Is Insufficient

Historically, running a query against searchtermview with a filter for campaign.advertisingchanneltype = 'PERFORMANCEMAX' yielded zero rows because PMax queries were excluded from the standard search term pipeline. Although Google has expanded API visibility, accessing search term insights across both campaign types requires joining data programmatically in memory within the script environment.

| Feature / Metric | Standard Search (searchtermview) | PMax (campaignsearchterminsight) |

| :--- | :--- | :--- |

| Granularity | Exact User Query String | Search Categories & Raw Clusters |

| Match Type Data | Exact, Phrase, Broad, Close Variant | Inferred / Machine Learning Match |

| Cost Reporting | Exact per query (metrics.costmicros) | Aggregated by insight cluster |

| Ad Rank Priority | Absolute if Exact match + budget exists | Wins on Ad Rank against Phrase/Broad |

| Direct Negative Control | Ad Group & Campaign Negatives | Account-level or Rep-added lists |

Architecture of a GAQL Cannibalization Script

The detection engine operates in four stages to isolate search terms active in both Standard Search and Performance Max campaigns:

[1. Fetch Active Campaigns]

│

├── Extract Search Campaigns (Type = SEARCH)

└── Extract PMax Campaigns (Type = PERFORMANCEMAX)

│

[2. Query GAQL Endpoints]

│

├── searchtermview (Search query strings, clicks, conversions, cost)

└── campaignsearchterminsight (PMax search clusters, clicks, conversions)

│

[3. Cross-Reference Engine (JavaScript)]

│

├── Normalize query strings (trim, lowercase, punctuation removal)

├── Build HashMaps of Search queries vs. PMax clusters

└── Calculate Overlap Severity Index

│

[4. Generate Diagnostic Output]

│

└── Output High-Risk Collisions to Google Sheet / Logs

Calculating the Overlap Severity Score

To prioritize which queries require immediate mitigation, the script calculates an Overlap Severity Score ($OSS$) for each overlapping search entity:

$OSS = \frac{\text{PMax Clicks}},{\text{Total Combined Clicks}} \times \text{Search Campaign Lost IS (Rank)}$

If PMax captures 60% of the traffic for a core commercial phrase, and your Standard Search campaign displays a high Impression Share Lost to Rank ($30\%$), this indicates PMax is aggressively driving up internal competition and outbidding your dedicated ad copy.

Step-by-Step: Writing and Deploying the Custom GAQL Script

Below is the complete, production-ready Google Ads Script designed to run inside your Google Ads account. It extracts search queries from your Search campaigns, extracts search term category insights from PMax, matches them in memory, and writes the overlapping targets directly into a structured log format (or can be directed to a Google Sheet).

The Complete Google Ads Script Code

javascript

/

• PMax vs. Search Query Cannibalization Detector

• Engine: GAQL / Google Ads Scripts

• Author: AdTurbo Technical Strategy

/

const CONFIG = {

LOOKBACKDAYS: 30,

MINIMPRESSIONS: 10,

OVERLAPTHRESHOLDPERCENT: 15, // Flag if PMax captures 15% of shared volume

SPREADSHEETURL: '' // Optional: Paste a blank Google Sheet URL here with edit access

};

function main() {

const dateRange = getDateRange(CONFIG.LOOKBACKDAYS);

Logger.log(Starting query cannibalization scan for period: ${dateRange.start} to ${dateRange.end});

// Step 1: Pull Search Campaign Query Data

const searchQueryMap = getSearchCampaignQueries(dateRange);

Logger.log(Indexed ${Object.keys(searchQueryMap).length} unique search terms from Search campaigns.);

// Step 2: Pull Performance Max Insight Clusters

const pmaxClusterMap = getPMaxSearchInsights(dateRange);

Logger.log(Indexed ${Object.keys(pmaxClusterMap).length} search insight clusters from PMax campaigns.);

// Step 3: Identify Intersections and Collisions

const cannibalizationReport = detectCollisions(searchQueryMap, pmaxClusterMap);

Logger.log(Detected ${cannibalizationReport.length} potential cannibalization points.);

// Step 4: Output Findings

exportResults(cannibalizationReport);

}

function getSearchCampaignQueries(dateRange) {

const queryMap = {};

const gaqlQuery =

SELECT

campaign.id,

campaign.name,

segments.searchterm,

segments.searchtermmatchtype,

metrics.clicks,

metrics.impressions,

metrics.costmicros,

metrics.conversions

FROM searchtermview

WHERE

segments.date BETWEEN '${dateRange.start}' AND '${dateRange.end}'

AND metrics.impressions = ${CONFIG.MINIMPRESSIONS}

AND campaign.advertisingchanneltype = 'SEARCH'

AND campaign.status = 'ENABLED'

;

const searchResults = AdsApp.search(gaqlQuery);

while (searchResults.hasNext()) {

const row = searchResults.next();

const rawTerm = row.segments.searchTerm;

const normalizedTerm = normalizeString(rawTerm);

if (!queryMap[normalizedTerm]) {

queryMap[normalizedTerm] = {

rawTerm: rawTerm,

campaigns: new Set(),

clicks: 0,

impressions: 0,

cost: 0,

conversions: 0,

matchTypes: new Set()

};

}

queryMap[normalizedTerm].campaigns.add(row.campaign.name);

queryMap[normalizedTerm].clicks += parseInt(row.metrics.clicks || 0, 10);

queryMap[normalizedTerm].impressions += parseInt(row.metrics.impressions || 0, 10);

queryMap[normalizedTerm].cost += parseFloat(row.metrics.costMicros || 0) / 1000000;

queryMap[normalizedTerm].conversions += parseFloat(row.metrics.conversions || 0);

queryMap[normalizedTerm].matchTypes.add(row.segments.searchTermMatchType);

}

return queryMap;

}

function getPMaxSearchInsights(dateRange) {

const pmaxMap = {};

const gaqlQuery =

SELECT

campaign.id,

campaign.name,

campaignsearchterminsight.categorylabel,

metrics.clicks,

metrics.impressions,

metrics.conversions

FROM campaignsearchterminsight

WHERE

segments.date BETWEEN '${dateRange.start}' AND '${dateRange.end}'

AND campaign.advertisingchanneltype = 'PERFORMANCEMAX'

AND campaign.status = 'ENABLED'

;

try {

const pmaxResults = AdsApp.search(gaqlQuery);

while (pmaxResults.hasNext()) {

const row = pmaxResults.next();

const rawCluster = row.campaignSearchTermInsight.categoryLabel || '';

const normalizedCluster = normalizeString(rawCluster);

if (!normalizedCluster) continue;

if (!pmaxMap[normalizedCluster]) {

pmaxMap[normalizedCluster] = {

rawCluster: rawCluster,

campaigns: new Set(),

clicks: 0,

impressions: 0,

conversions: 0

};

}

pmaxMap[normalizedCluster].campaigns.add(row.campaign.name);

pmaxMap[normalizedCluster].clicks += parseInt(row.metrics.clicks || 0, 10);

pmaxMap[normalizedCluster].impressions += parseInt(row.metrics.impressions || 0, 10);

pmaxMap[normalizedCluster].conversions += parseFloat(row.metrics.conversions || 0);

}

} catch (e) {

Logger.log('Note: campaignsearchterminsight query yielded an API exception or no rows: ' + e.message);

}

return pmaxMap;

}

function detectCollisions(searchQueries, pmaxClusters) {

const collisions = [];

for (const [searchTerm, searchData] of Object.entries(searchQueries)) {

for (const [pmaxCluster, pmaxData] of Object.entries(pmaxClusters)) {

// Check direct inclusion or exact token match

if (searchTerm.includes(pmaxCluster) || pmaxCluster.includes(searchTerm)) {

const totalClicks = searchData.clicks + pmaxData.clicks;

const pmaxShare = totalClicks 0 ? (pmaxData.clicks / totalClicks) 100 : 0;

if (pmaxShare = CONFIG.OVERLAPTHRESHOLDPERCENT) {

collisions.push({

query: searchData.rawTerm,

pmaxCluster: pmaxData.rawCluster,

searchCampaigns: Array.from(searchData.campaigns).join(', '),

pmaxCampaigns: Array.from(pmaxData.campaigns).join(', '),

searchClicks: searchData.clicks,

pmaxClicks: pmaxData.clicks,

searchCost: searchData.cost.toFixed(2),

pmaxSharePercent: pmaxShare.toFixed(1),

searchConversions: searchData.conversions.toFixed(1),

pmaxConversions: pmaxData.conversions.toFixed(1)

});

}

}

}

}

return collisions;

}

function normalizeString(str) {

if (!str) return '';

return str.toLowerCase()

.replace(/[^a-z0-9\s]/g, '')

.replace(/\s+/g, ' ')

.trim();

}

function getDateRange(daysBack) {

const end = new Date();

end.setDate(end.getDate() - 1); // Yesterday

const start = new Date();

start.setDate(start.getDate() - daysBack);

return {

start: Utilities.formatDate(start, AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd'),

end: Utilities.formatDate(end, AdsApp.currentAccount().getTimeZone(), 'yyyy-MM-dd')

};

}

function exportResults(collisions) {

if (collisions.length === 0) {

Logger.log('Great news! No query cannibalization detected meeting the threshold.');

return;

}

Logger.log('--- CANNIBALIZATION REPORT ---');

collisions.forEach(c = {

Logger.log([ALERT] Query: "${c.query}" | Overlapping PMax Cluster: "${c.pmaxCluster}");

Logger.log( Search Clicks: ${c.searchClicks} | PMax Clicks: ${c.pmaxClicks} (PMax Share: ${c.pmaxSharePercent}%));

Logger.log( Search Campaigns: ${c.searchCampaigns});

Logger.log( PMax Campaigns: ${c.pmaxCampaigns}\n);

});

if (CONFIG.SPREADSHEETURL) {

try {

const ss = SpreadsheetApp.openByUrl(CONFIG.SPREADSHEETURL);

let sheet = ss.getSheetByName('Cannibalization Report');

if (!sheet) {

sheet = ss.insertSheet('Cannibalization Report');

}

sheet.clear();

sheet.appendRow([

'Search Query', 'PMax Cluster', 'Search Campaigns', 'PMax Campaigns',

'Search Clicks', 'PMax Clicks', 'Search Cost ($)', 'PMax Share %',

'Search Conv', 'PMax Conv'

]);

collisions.forEach(c = {

sheet.appendRow([

c.query, c.pmaxCluster, c.searchCampaigns, c.pmaxCampaigns,

c.searchClicks, c.pmaxClicks, c.searchCost, c.pmaxSharePercent,

c.searchConversions, c.pmaxConversions

]);

});

Logger.log(Exported results to spreadsheet: ${CONFIG.SPREADSHEETURL});

} catch (err) {

Logger.log(Failed to write to Google Sheet: ${err.message});

}

}

}

Deployment Checklist

1. Open your Google Ads Manager or Single Account dashboard.

2. Navigate to Tools and Settings Bulk Actions Scripts.

3. Click the blue + button to create a new script.

4. Paste the code above into the script editor window.

5. Click Authorize to grant the script access to run GAQL queries and access Google Sheets.

6. Update LOOKBACKDAYS (default 30) and paste your target SPREADSHEETURL if you want a visual export.

7. Click Preview to verify performance, inspect logs, and review the collision matrix.

Executing scripts like this manually is essential when diagnosing an account, but maintaining script hygiene across multiple campaigns takes constant vigilance. Using dedicated Google Ads automation tools can systematically flag these auction collisions without the ongoing overhead of manually maintaining custom API scripts.

5 Critical Diagnostic Signals of PMax Search Cannibalization

Running your google ads query cannibalization gaql script generates detailed operational data. When analyzing the script output, look for these five specific warning signals:

1. CPC Inflation on Core High-Intent Keywords

When a Standard Search campaign and a Performance Max campaign bid on the same underlying consumer query, Smart Bidding targets double down on the same entity. While Google prevents an advertiser from physically bidding against themselves in a single second-price auction step, running two campaigns with overlapping targeting allows Smart Bidding to bid higher from whichever campaign has higher aggressive target flexibility. Check your search terms report guide metrics alongside the script output: if Search CPCs have spiked 25%–45% while PMax search category volume expanded, cross-campaign auction pressure is occurring.

2. Search Campaign Impression Share Lost to Rank Increases

Track Search Lost IS (Rank) in your dedicated Search campaigns. If your budget is uncapped, yet Impression Share Lost to Rank rises while overall conversion volume stays flat, PMax is winning Ad Rank decisions over your standard Broad and Phrase match keywords. PMax's machine-assembled creatives and dynamically injected landing page assets frequently push its predicted CTR higher than static text ads, forcing the Search campaign to concede the impression.

3. PMax Encroaching on Branded Queries Despite "Brand Exclusions"

Google allows advertisers to implement "Brand Lists" as exclusions on Performance Max campaigns. However, brand exclusions rely on Google's knowledge graph entity recognition. If users search for misspelled brand variants, niche sub-brands, or long-tail brand + location queries, brand exclusions often fail to trigger. Your GAQL script will quickly reveal whether brand terms are slipping past the exclusion filter into PMax clusters.

4. Conversion Attribution Shifting with Stagnant Blended Revenue

Examine the distribution of conversions reported by the script. If a Search keyword that previously delivered 100 conversions a month drops to 40, while a PMax search cluster gains 60 conversions for identical terminology, no business growth occurred. PMax simply poached high-intent buyers already searching directly for your core offering.

5. Asset Group Dilution and Low Search Term Relevancy

When PMax enters search auctions for specific terms, it dynamically matches headlines from your asset groups. If your asset group contains generalized creative assets rather than copy tailored specifically to that search intent, your conversion rate drops. PMax captures the click at the expense of your tailored Search ad group, resulting in wasted spend and higher cost per acquisition. Conducting regular audits using a structured PPC audit checklist helps identify these structural leaks before budget is squandered.

Remediation Strategies: Restoring Search Campaign Dominance

Once the GAQL script confirms internal competition, implement these remediation strategies to re-establish clean campaign segmentation.

[Cannibalization Detected]

│

┌──────────────────────┴──────────────────────┐

▼ ▼

[Brand Cannibalization], [Non-Brand Overlap]

│ │

┌──────┴─────────────────────┐ ┌──────┴─────────────────────┐

│ Apply Brand Exclusion List │ │ Convert to Exact Match │

│ File Negatives via Support │ │ Add Account Negatives │

└────────────────────────────┘ │ Implement Shared Negatives │

└────────────────────────────┘

1. Enforce Hard Exact Match Silos

Because Google prioritizes Exact match keywords over Performance Max (provided budget and targeting criteria are satisfied), audit all keywords identified in the collision script. Convert crucial high-volume Phrase and Broad match keywords in your dedicated Search campaigns into Exact match. Ensure those ad groups maintain sufficient daily budget so PMax is never permitted to capture impressions due to budget depletion.

2. Apply Rigorous Account-Level Negative Lists

To prevent PMax from serving ads against terms you are already aggressively bidding on in Search campaigns, apply account-level negative keyword lists. Account-level negatives apply universally to all campaigns, including Performance Max, Search, and Shopping.

Review proven lists such as 100+ negative keyword examples and extract the queries flagged by your GAQL script. Adding them to an account-level negative list immediately blocks PMax from entering those specific auctions.

Warning: If you add a term to the Account-Level Negative list, it will also block your Standard Search campaigns. Use account-level lists exclusively for non-converting, junk, or competitor queries that neither campaign should touch. For terms you want Search to handle exclusively, utilize campaign-specific negative lists applied to PMax via a Google Representative or script.

3. Request PMax Campaign-Level Negative Keyword Lists

Google Ads does not allow native self-service management of campaign-level negative lists on Performance Max directly inside the primary campaign settings interface. However, you can attach a shared negative keyword list to a Performance Max campaign through two methods:

• Google Support Request: Submit a support ticket requesting the addition of an existing negative keyword list to a specific Performance Max Campaign ID.

• Google Ads Scripts / API: In select account tiers, scripts can attach campaigncriterion negative lists directly to PMax instances.

4. Design a 4-Week Holdout Incrementality Test

Never assume an overlap change succeeded without empirical testing. When restructuring PMax or applying aggressive negative filters to halt query poaching, establish a clear 4-week testing window:

1. Weeks 1–2 (Baseline): Track combined Search + PMax conversion volume, blended CPA, and blended ROAS.

2. Week 3 (Implementation): Deploy negatives to PMax to exclude core commercial queries; reinforce Search budgets on Exact match variants.

3. Weeks 4–6 (Measurement): Observe blended business performance. If combined revenue holds steady or increases while total ad spend drops, you have successfully eliminated cannibalistic waste.

If you lack the time to run manual regression scripts every week, running an automated free Google Ads audit can pinpoint immediate query leaks, negative conflicts, and auction overlap across your account in minutes.

Long-Term Campaign Architecture for Harmony

To ensure your Google Ads account runs smoothly over time, establish a structural hierarchy that defines clear responsibilities for each campaign type.

Standard Search Campaigns: The High-Intent Moat

Search campaigns should act as your primary capture engine for proven, high-intent traffic:

• Exact Match Isolation: Reserve exact match ad groups for your primary revenue-driving keywords, ensuring highest possible Quality Scores and dedicated landing page matching.

• Tight Ad Group Segmentation: Organize search ad copy around narrow themes to maximize relevance and maintain expected CTR advantages over PMax.

• Strict Budget Protection: Keep high-performing Search campaigns fully funded to prevent PMax from stepping in during mid-day budget exhaustions.

Performance Max: The Incremental Reach Engine

Performance Max should be configured to find net-new volume across inventory where Search cannot reach:

• Visual and Multi-Channel Reach: Leverage PMax for YouTube, Gmail, Discover, and Shopping inventories rather than plain text search.

• Audience Signals, Not Query Traps: Supply first-party customer lists, high-intent custom segments, and conversion lookalikes as audience signals, rather than loading Search Themes that replicate your existing search keyword catalog.

• Exclusion Guardrails: Maintain active brand exclusions and regular negative list maintenance to keep PMax focused on prospecting rather than capturing existing brand equity.

Automating this separation with specialized tools—such as AdTurbo's platform, which continuously monitors cross-campaign query routing—typically reduces wasted duplicate spend by [15%-30%] while stabilizing average account CPCs.

Related Guides

• How to Use the Google Ads Search Terms Report to Cut Wasted Spend

• PPC Audit Checklist: 12 Steps to Fix a Leaking Google Ads Account

• How to Find Negative Keywords in Google Ads (Step by Step)

Frequently Asked Questions

Do PMax campaigns have keywords?

No, Performance Max campaigns do not use traditional targetable keywords. Instead, they utilize Search Themes and Audience Signals as directional indicators, while automated algorithms dynamically match ads to user queries, product inventory, and landing page content across the entire Google network.

Where can I see my Quality Score in Google Ads?

Quality Score is visible within your Standard Search campaigns at the Keywords level. Navigate to the Keywords tab, click Columns Modify Columns, expand the Quality Score section, and select metrics such as Quality Score, Expected CTR, Ad Relevance, and Landing Page Experience.

What is the main goal of the Google Ads Performance Planner tool?

The primary goal of the Performance Planner tool is to model future spend, conversion volume, and ROAS across campaigns using machine learning simulations of past auction data. It helps advertisers forecast how adjustments to target CPAs, target ROAS, and monthly budgets will affect overall performance.

How can you use the optimization score to benefit your campaign?

The optimization score provides automated recommendations on account health, budgeting, and asset coverage, grading your setup from 0% to 100%. While it highlights technical oversights like missing assets or broken tracking, you should review each recommendation critically rather than auto-applying suggestions that might dilute targeted bidding strategies.