A server-side technical approach to analyze where your PMax campaign clicks are really coming from.
Performance Max campaigns promise to maximize conversions by leveraging Google’s entire inventory (Search, Display, YouTube, Discover, Gmail, Maps) through a single AI-driven campaign.
However, this power comes with a significant challenge for marketers and analysts: a lack of transparency. PMax often operates like a “black box,” making it difficult to understand which channels are generating the most valuable clicks and conversions.
How can we optimize budgets and creatives if we don’t know what’s working best?
Fortunately, there are technical methods to shed some light inside this black box. In this article, we’ll explore how to use specific URL parameters, particularly gad_source, and capture them server-side to gain valuable insights into the real traffic sources of our Performance Max campaigns.

The "Black Box" Dilemma of Performance Max
Anyone managing PMax campaigns has faced the limitations of standard reports. Google Ads provides aggregated performance data but rarely offers granular details on where clicks are actually coming from:
How many clicks are really from Google Search?
What is the contribution of the Display Network?
Is YouTube playing a significant role?
Are Shopping ads within PMax performing as expected?
This lack of detail makes strategic decisions on budget allocation, asset prioritization (images, videos, text), and deep customer journey understanding more complex. We rely on the algorithm but lose part of our control and insight.
Hidden Clues in URLs: gclid and the Lesser-Known gad_source
When a user clicks on a Google Ads ad, Google automatically appends parameters to the destination URL. The most well-known is:
gclid (Google Click Identifier): A unique identifier essential for offline conversion tracking and linking site sessions to a specific campaign/keyword in Google Ads and Google Analytics. Its presence confirms that the click originated from the Google Ads ecosystem.
However, there’s another lesser-documented but highly useful parameter:
gad_source: This parameter appears to indicate the specific “source” or network type within Google Ads where the click originated.
Based on community observations (note: Google may change these values without notice), the known gad_source values seem to correspond to:
gad_source | Traffic Source |
---|---|
1 | Clicks from Google Search Ads (standard Search campaigns) |
2 | Clicks from Google Display Network (banner/display ads) |
3 | Clicks from YouTube Ads |
4 | Clicks from Discovery Ads |
5 | Clicks from Google Shopping Ads (including PMax with feed, legacy Smart Shopping, standard Shopping) |
The combined presence of gclid and a specific gad_source value in a landing page URL provides a valuable clue about the click’s originating network, even within a Performance Max campaign.
The Solution: Server-Side Tracking
Why is server-side tracking crucial?
Reliability: URL parameters can be lost during redirects, due to site configurations, or because of client-side scripts before analytics tools (like Google Analytics tags running in the browser) can capture them.
Immediacy: Capturing data as soon as the request reaches the server (before the page fully renders) maximizes the chances of obtaining intact parameters.
The idea is to intercept the incoming request on our web server, analyze the gclid and gad_source parameters in the URL, and log this data before any other site logic intervenes.
Practical Implementation (Conceptual Framework)
To implement this tracking, you need to integrate a specific logic into your website’s backend. This should be executed early in the HTTP request lifecycle ideally, as soon as the server receives the request and before it begins generating the response (the web page itself).
How It Works:
Intercept Incoming Requests
Capture the full URL of the request.
Extract and log the gclid and gad_source parameters.
Store Data Securely
Log it in a structured database table or a log file.
If using a database, ensure the table is indexed for fast queries.
Analyze Trends Over Time
Aggregate gad_source values to see which networks drive the most traffic.
Compare against conversions for indirect performance evaluation.
// Concept: Server-side script to log Google Ads source info
// Attach this logic to run early for incoming web requests
onHttpRequestStart( request => {
// Skip if it's an admin or system internal request
if (isSystemInternalRequest(request) || isAdminUser(request)) {
return; // Do nothing
}
// Get URL query parameters
const params = request.getUrlParameters();
const gclid = params.get('gclid');
// Must have gclid to proceed
if (!gclid) {
return; // Not a direct Google Ads click we are tracking here
}
// Get gad_source if available
const gad_source = params.get('gad_source') || 'N/A';
// Collect other useful data
const timestamp = getCurrentTimestamp();
const ipAddress = getRealVisitorIp(request.headers);
const url = request.getFullUrl();
const userAgent = request.headers['User-Agent'] || 'N/A';
// Format data for logging
const logEntry = `[${timestamp}] Source: ${gad_source} | gclid: ${gclid} | IP: ${ipAddress} | URL: ${url} | UA: ${userAgent}`;
// Store the log entry (e.g., append to a file)
appendToServerLogFile('/logs/gads_tracking.log', logEntry);
// Or alternatively, insert into a database
// database.insert('tracking_logs', { timestamp, gad_source, gclid, ipAddress, url, userAgent });
});
// --- Helper function examples (conceptual) ---
function isSystemInternalRequest(request) { /* ... logic ... */ }
function isAdminUser(request) { /* ... logic ... */ }
function getRealVisitorIp(headers) { /* ... logic to check common IP headers ... */ }
// ... other helpers ...
Analyzing the Collected Data
Once tracking is in place, you’ll start accumulating data in your logs or database. What can you do with it?
Source Distribution: Count visits for each gad_source value (1, 2, 3, 4, 5, or N/A if missing). This provides a percentage breakdown of how PMax is distributing clicks across networks.
Trend Monitoring: Observe how PMax shifts its allocation over time.
Advanced Correlation: While this tracking doesn’t directly link visits to conversions, analyzing periods with conversion spikes alongside an increase in gad_source=5 (Shopping) clicks can suggest strong Shopping performance.
Optimization Insights:
If most clicks come from gad_source=1 (Search), focus on improving text assets.
If gad_source=3 (YouTube) is dominant, invest in higher-quality video assets.
Key Limitations and Considerations
Not Officially Documented: gad_source values are based on observations and may change. Use them as indicators, not absolute truths.
Not Always Present: Some PMax clicks may lack gad_source, showing up as N/A in logs. However, they still originate from Google Ads (confirmed by gclid).
Limited Granularity: This method identifies the network, but not the specific campaign or asset within PMax.
Performance Considerations:
Use log rotation if storing data in a file to prevent excessive size.
Ensure database indexing for fast queries.
Privacy Compliance: If logging IP addresses, ensure GDPR compliance. Consider anonymization if full IP storage isn’t necessary.
Performance Max remains a powerful but inherently opaque tool. Implementing server-side tracking for parameters like gclid and gad_source restores a level of visibility that would otherwise be lost.
Despite its limitations, this technical approach provides valuable data on how PMax distributes traffic across Google’s networks, allowing for more informed decisions on asset optimization and overall strategy.
It’s a step forward in turning the “black box” into a “gray box,” offering actionable insights where Google Ads’ standard reports fall short.
Need Help Implementing gad_source Tracking?
Want to set up this tracking correctly? Digital Connect can help. Contact us for a quick and effective solution!