In a Google Ads API report, every segment you add splits each row into one row per segment value, so row counts grow fast and the same spend is spread over more lines. Some segments also filter: any segments.keyword field keeps only Search keyword rows, which Google says leaves out Dynamic Search Ads, Shopping and Performance Max. When the Google Ads connector is available, etlmcp avoids both traps. It segments by day only, and it delivers ad-level rows plus a campaign-level remainder row, so campaigns without ads, such as Performance Max, still count in your totals.
How segments change the shape of a report
A Google Ads query reads from one resource, named in its FROM clause, and that resource already divides the report: querying ad_group returns one row per ad group even if you select no ad group field. Adding a segment field to the SELECT list then cuts each of those rows into one row per value of the segment. Google's example is segments.device on campaign, which gives a row per campaign and device, with impressions and the other metrics divided between them.
The API, unlike the Google Ads interface, lets you add several segments to one query, and each one multiplies again: a campaign report by day, device and network has one row per campaign, day, device and network. Two consequences follow:
- A row is no longer a campaign or an ad. Before you count rows or average a metric, know which segments the export used.
- Summing is safe only across the segment values of one query. If you join two exports with different segments, you count the same spend twice.
Which segments a resource accepts is listed on that resource's metadata page, and each segment narrows what can join it. Date segments have their own rules: if you select segments.date, segments.week, segments.month, segments.quarter or segments.year, the query needs a finite date range in its WHERE clause. The segments.date, segments.week and segments.hour segments reach back 37 months; for older history Google points you to the month, quarter or year segments.
Keyword segments filter as well as split
Google's segmentation guide says the segments.keyword fields limit results to rows tied to Search Network keyword criteria. Campaign types that do not target keywords drop out: Dynamic Search Ads target from your site's content and Shopping targets product groups, so neither appears. Google lists Performance Max among the excluded types too, because its reporting is not usually broken down by those keyword criteria. Display keywords are not covered by these fields either.
If you build a spend total from a keyword report, it will fall short of the account's total by whatever those campaigns spent. Google's advice is to look at all campaign types first and add keyword segments only when you are studying Search keywords.
Why Performance Max is missing from ad reports
Performance Max campaigns have no ad groups and no ads. They are built from asset groups, and Google's Performance Max reporting guide says that queries on ad_group or ad_group_ad return nothing for them. A report built only from the ad level therefore leaves out all Performance Max spend, without an error. Campaign-level reporting on the campaign resource is where those figures appear.
The grain etlmcp delivers
When the Google Ads connector is available, each sync makes two reads for every date window: one on ad_group_ad and one on campaign, both with segments.date as the only segment. Neither read filters on status, so removed ads and campaigns keep their past spend. No device, network or keyword segment is requested, so no segment splits the rows further or filters any out.
etlmcp then merges the two levels:
- Every ad row is delivered as it is, with its campaign, ad group and ad.
- For each campaign and day, etlmcp subtracts the sum of that campaign's ads from the campaign's own figures. If anything is left, it adds one campaign-level row carrying only that remainder, with the ad group and ad left empty.
- A campaign with no ads at all, such as Performance Max, gets its full figures as a campaign-level row.
A remainder is never negative: where the ads add up to more than the campaign reported, that metric's remainder is zero. Conversion differences of rounding size are treated as zero, so you do not get rows that only carry noise.
Because clicks, cost and conversions can change between the two reads, the campaign level is read before the ads, and when a campaign other than Performance Max shows a remainder, etlmcp reads the campaign level a second time and takes, for each figure, the lower of the two campaign reads. This keeps a change Google made while the ads were being read from turning into a remainder row. Recent days are pulled again on later syncs: a routine sync re-pulls the last 31 days.
Working with the two row levels
Each row carries columns that say where it came from, kept among the platform's own extras:
| Column | What it holds |
|---|---|
extra.row_level |
ad for an ad row, campaign for a remainder row |
extra.channel_type |
the campaign's channel type, such as PERFORMANCE_MAX, on campaign-level rows only |
extra.ad_type |
the ad's type, on ad rows only |
Use them like this:
- Account or campaign totals: sum every row. The ad rows plus the remainder rows give each campaign's figures, Performance Max included, with nothing counted twice.
- Ad performance: keep only rows where
extra.row_levelisad. Performance Max will not be among them, because it has no ads. - Performance Max alone: filter on
extra.channel_typeequal toPERFORMANCE_MAX. - Row counts: count ad rows only. A remainder row is not an ad, and a day with no remainder has none.
In a PostgreSQL destination these columns keep their dotted names, so write them in double quotes in SQL, for example "extra.row_level". The common columns, such as cost and conversions, are described on the Google connector page. To read rows from an agent, see query_data.