Aller au contenu principal
Reporting docs
Use case Codex + Yield

Yield leakage finder

Unsold inventory audit with Codex

Ask Codex to find ad units with unfilled impressions, low fill rate, and enough volume to deserve yield work.

User prompt

"Codex, inspect the last 7 days of GAM inventory. Rank ad units where unfilled impressions are high, fill rate is below 85%, and requests are large enough to matter. Give me fixes by priority."

Expected outcome

A prioritized inventory list with unfilled volume, fill rate, likely cause and first remediation.

Agent workflow

  1. 01

    Fetch inventory data for the selected window.

  2. 02

    Sort by UNFILLED_IMPRESSIONS and filter low FILL_RATE rows.

  3. 03

    Recommend demand, floor, ad unit or tagging checks.

MCP functions

Parent MCP call shown with the reporting action.

FunctionCostPurpose
reporting(action="run_custom_report")0.5 crRuns the full unsold inventory report with AD_REQUESTS, UNFILLED_IMPRESSIONS and FILL_RATE.
reporting(action="get_report_metrics")0 crChecks whether FILL_RATE and UNFILLED_IMPRESSIONS are available.
reporting(action="fetch_inventory_report")0.5 crRuns a narrower ad unit inventory check when the issue is already scoped.
reporting(action="export_report_csv")0.5 crExports the ranked leak list.

JSON payload

{
  "tool": "reporting",
  "arguments": {
    "action": "run_custom_report",
    "params": {
      "api": "rest",
      "dateRangeType": "FIXED",
      "startDate": "2026-06-02",
      "endDate": "2026-06-08",
      "dimensions": [
        "DATE",
        "AD_UNIT_NAME",
        "AD_UNIT_CODE",
        "DEVICE_CATEGORY_NAME"
      ],
      "metrics": [
        "AD_REQUESTS",
        "AD_SERVER_IMPRESSIONS",
        "UNFILLED_IMPRESSIONS",
        "FILL_RATE"
      ]
    }
  }
}

Representative output

  • Top leak: News/Article/Mobile has 482,913 UNFILLED_IMPRESSIONS and 71.4% FILL_RATE.
  • Likely cause: demand gap on DEVICE_CATEGORY_NAME=Mobile, not a site-wide outage.
  • Next step: compare floor rules and bidder coverage for the top 5 ad units.

Dimensions and metrics

Dimensions
NameSourceDescription
AD_UNIT_NAMEGAMInventory name
AD_UNIT_CODEGAMTag code
DATEGAMDaily split
DEVICE_CATEGORY_NAMEGAMDevice class
Metrics
NameSourceDescription
AD_REQUESTSGAMDemand opportunities
AD_SERVER_IMPRESSIONSGAMFilled impressions
UNFILLED_IMPRESSIONSGAMUnsold impressions
FILL_RATEGAMFill ratio

Limits

  • run_custom_report costs credits because it executes a GAM report.
  • Use fetch_inventory_report only for a quick ad unit sanity check; the full leak analysis needs AD_REQUESTS, UNFILLED_IMPRESSIONS and FILL_RATE.
  • Use SOAP only when the required legacy inventory metric is unavailable in REST.
  • Validate every field against the dimensions and metrics reference before automating the prompt.
Codex can turn this into issues or code tasks, but the MCP report itself is read-only.
Read the Academy guide

Use the editorial guide for the audience framing, then come back here for exact MCP actions, fields and payloads.

Read the Academy guide
Field references