A row with a campaign but no ad group and no ad is a campaign-level remainder, not a broken row. When the Microsoft Advertising connector is available, etlmcp asks Microsoft for two reports over every window of dates: the ad performance report for the detail and the campaign performance report for the totals. For each campaign and day, whatever the campaign figures hold beyond the sum of its ad rows becomes one extra row at campaign level, marked with row_level set to campaign. These rows are what make your table add up to Microsoft's own campaign totals. Filter on row_level to keep ad rows and campaign remainders apart.
Why the ad report alone is not enough
Microsoft's ad performance report reference does not promise that every campaign type shows up there in full. Microsoft also documents a separate asset group performance report, and asset groups are what you add to a Performance Max campaign: the AddAssetGroups operation takes the ID of the Performance Max campaign they belong to. Microsoft presents the asset group report as a way to compare results by asset group, campaign or account, and its scope can narrow to accounts, campaigns or asset groups, with no ad group or ad level.
Once the connector is available, etlmcp does not trust the ad report to hold everything. It uses the campaign report as the reference, since Microsoft describes it as giving statistics for each campaign, and it fills any gap with a campaign-level row. etlmcp does not request the asset group report, so a Performance Max campaign shows up in your table as campaign-level rows, not broken down by asset group.
The three outcomes for a campaign and day
When the connector is available, etlmcp compares impressions, clicks, cost, conversions and conversion value, campaign by campaign and day by day. Several ad rows with the same ad on the same day are summed first.
- The ad rows match the campaign. Impressions and clicks are equal and the money and conversion figures differ only by rounding. You get the ad rows and no campaign row.
- The campaign holds more. The difference for each metric becomes one campaign-level row. A campaign with no ad rows at all that day, such as one whose delivery the ad report does not cover, gets a single row carrying all of its figures. A difference that is zero on every metric writes nothing.
- The ad rows hold more. If the ad rows add up to more than the campaign for any metric, beyond what rounding across many rows can explain, no remainder can be right. The campaign's own row replaces the ad rows for that day, so you lose the ad detail for that campaign and day but keep the correct total.
In every case, for each campaign and day that the campaign report contains, the rows in your table add up to Microsoft's campaign figure, give or take rounding. If the ad report has rows for a campaign and day that the campaign report lacks, etlmcp keeps those ad rows as they are.
How to tell the rows apart
A campaign-level row has empty ad group and ad ids and names, and row_level set to campaign. Ad rows leave row_level empty and carry ad_type when Microsoft fills it. Both kinds carry campaign_type whenever Microsoft fills it, and Microsoft's column reference lists values such as Audience, Dynamic search, Performance max, Search & content and Shopping.
In a CSV file or a PostgreSQL table these land in columns with an extra. prefix: extra.row_level, extra.campaign_type and extra.ad_type. Some patterns:
- Account or campaign totals: sum every row. A remainder holds only what the ad rows lack, so nothing is counted twice.
- Ad analysis: keep rows where
extra.row_levelis empty: an empty cell in CSV,NULLin PostgreSQL. - Where the gaps are: keep rows where
extra.row_leveliscampaignand group byextra.campaign_type. If a campaign type you run shows up with large remainders every day, much of its delivery is missing from the ad report. - Rates: compute CTR, CPC and CPA from summed clicks, impressions, cost and conversions. The stored rates on a remainder row describe only the remainder.
SELECT "extra.campaign_type" AS campaign_type,
SUM(cost) AS cost_without_ads
FROM microsoft_ads_daily
WHERE "extra.row_level" = 'campaign'
GROUP BY 1;
In PostgreSQL, put the dotted names in double quotes, as above. Your table name is whatever your pipeline writes to.
Remainders change with the re-pull
Each routine sync pulls the last 31 days again and replaces them. Each re-pull compares both reports afresh, so a remainder row for a recent day can grow, shrink or disappear between syncs. Read a small remainder on yesterday's data as provisional.
For the columns the connector writes and how the reports are fetched, see the Microsoft Advertising connector reference and how a Microsoft Advertising sync works. Google Ads has the same kind of row for its own reasons: see Performance Max in Google Ads data.