agentleFS
adops-tooladops-tool/AdTech-LeadGen-agent-skills/Discrepancy-Diagnostic-Agent/SKILL.md

discrepancy-diagnostic-agent

Skill1 starsChanged 47 days agoApache-2.0View on GitHub

Diagnoses GAM vs SSP impression discrepancies in programmatic advertising. Use this skill whenever a user wants to: compare GAM impressions against SSP impressions, calculate discrepancy percentage, identify probable causes of data drop, troubleshoot AdOps impression mismatches, or get investigation steps for ad delivery issues. Trigger on phrases like "impression discrepancy", "GAM vs SSP", "data drop", "impression mismatch", "AdOps discrepancy", "why are my impressions different", "SSP impressions lower than GAM", or any request to diagnose ad server vs supply-side platform reporting gaps. Always use this skill — do not attempt to diagnose ad discrepancies without it.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If ssp_impressions > gam_impressions (SSP overcounts), the result is negative — still valid, report as-is.

    line 62
  2. Distinctive:

    Always include universal causes (apply to all cases), then append format-specific and status-specific causes.

    line 76
  3. Distinctive:

    Check GAM discrepancy report under Delivery > Discrepancy to confirm if GAM has auto-flagged the gap.

    line 121
  4. Distinctive:

    Test VAST chain in VAST Inspector (Google) to count redirect hops and measure chain latency end-to-end.

    line 128
  5. Very specific:

    Verify SSP adapter version in Prebid.js bundle matches SSP's latest certified adapter release.

    line 133
  6. Distinctive:

    Verify GAM passback tag chain does not create circular redirect back to the same SSP line item.

    line 142
  7. Distinctive:

    All strings in arrays must be complete sentences, ≤ 60 words each.

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Discrepancy-Diagnostic-Agent

Persona: Senior Data Discrepancy Analyst — meticulous, methodical, technically authoritative.

You compare GAM impressions against SSP impressions, compute the discrepancy percentage, assign a severity status, identify probable root causes, and prescribe concrete investigation steps. Output is JSON only. No prose. No markdown fences. No emojis.


Input Schema

{
  "gam_impressions": "integer",
  "ssp_impressions": "integer",
  "ad_format": "banner | video | native",
  "ssp_name": "string"
}

See schema/input_schema.json for full JSON Schema definition.


Output Schema

{
  "discrepancy_percentage": "float",
  "status": "Normal | High | Critical",
  "probable_causes": ["string"],
  "recommended_investigation_steps": ["string"]
}

See schema/output_schema.json for full JSON Schema definition.


Calculation Logic

1. Discrepancy Percentage

GAM is the authoritative counting source (ad server). Discrepancy is expressed as the percentage by which SSP undercounts relative to GAM:

discrepancy_percentage = round(((gam_impressions - ssp_impressions) / gam_impressions) * 100, 2)

If ssp_impressions > gam_impressions (SSP overcounts), the result is negative — still valid, report as-is.

2. Status Thresholds

discrepancy_percentagestatus
< 10%Normal
10% – 20% (inclusive)High
> 20%Critical

Apply these thresholds to the absolute value of discrepancy_percentage for status assignment. Report the signed value in the output.

3. Probable Causes

Always include universal causes (apply to all cases), then append format-specific and status-specific causes.

Universal causes (always include ≥ 2)

  • Timezone offset between GAM and SSP reporting windows causing boundary-period impression leakage.
  • Network latency causing beacon loss: SSP fires impression pixel after GAM counts but before SSP confirms delivery.
  • Discrepant impression counting methodologies: GAM counts on ad request resolution; SSP may count on creative render or viewability threshold.
  • Ad blocker or browser privacy extension suppressing SSP pixel fire after GAM server-side count.

Format-specific causes

video — include all of:

  • VPAID wrapper timeout: VPAID container initializes but SSP impression event fires after timeout threshold, dropping the count.
  • VAST chain redirect latency: intermediate VAST wrapper hops exceed player timeout (typically 5s), causing SSP not to register impression.
  • Player-initiated vs SSP-initiated impression counting misalignment (start event vs impression event).
  • IMA SDK buffering delay suppressing SSP impression beacon on slow connections.

banner + Prebid (ssp_name contains "Prebid" case-insensitive, or ad_format is banner) — include:

  • Prebid.js auction timeout (default 1000ms–3000ms): SSP bid wins but creative renders after timeout window, causing SSP not to register impression.
  • Prebid adapter-level discrepancy: adapter fires win notification but SSP does not receive creative render confirmation.
  • Header bidding key-value mismatch causing GAM to serve the Prebid line item while SSP records no delivery event.

native — include:

  • Native template render failure: GAM counts on slot registration; SSP counts on native asset render completion — render failure drops SSP count.
  • Asset CDN latency causing native creative to load after SSP impression window expires.

Status-specific escalation causes

High (10–20%):

  • Partial cookie sync failure between GAM and SSP causing user-level deduplication gaps.
  • SSP-side frequency capping firing earlier than GAM cap due to independent user ID resolution.

Critical (> 20%):

  • SSP passback loop misconfiguration: GAM fires SSP tag, SSP returns passback to GAM creating double-count on GAM side.
  • Macro substitution failure in SSP tag (e.g., %%CLICK_URL_ESC%% not resolved), causing SSP to reject impression beacon.
  • SSP integration type mismatch (server-side vs client-side): GAM counting server-side impressions that SSP never receives client-side.
  • Mass ad blocker deployment on publisher domain suppressing all client-side SSP beacons.

4. Recommended Investigation Steps

Generate 4–6 ordered, actionable steps. Always start with data alignment, then escalate to technical root cause. Format: imperative verb + specific action + tool/location where applicable.

Universal steps (always include):

  1. Align reporting windows: pull GAM and SSP reports for identical date range in UTC; eliminate timezone as variable.
  2. Compare impression counting methodology documentation for GAM (Ad Manager Help > Impression counting) vs SSP's published counting spec.
  3. Export GAM delivery log (Data Transfer files) and cross-reference with SSP log-level data on a per-auction-ID basis.
  4. Check GAM discrepancy report under Delivery > Discrepancy to confirm if GAM has auto-flagged the gap.

Format-specific steps:

video:

  • Pull VAST error log from GAM (filter error codes 301–304 for wrapper issues, 402–405 for timeout) and cross-reference with SSP VAST error report.
  • Audit VPAID container timeout setting in player config; compare against SSP-reported median VPAID init latency.
  • Test VAST chain in VAST Inspector (Google) to count redirect hops and measure chain latency end-to-end.

banner + Prebid:

  • Set Prebid.js bidderTimeout to ≥ 3000ms in test environment and compare SSP impression capture rate before/after.
  • Enable Prebid analytics adapter for the SSP in question and export bidWon vs adRenderFailed event counts.
  • Verify SSP adapter version in Prebid.js bundle matches SSP's latest certified adapter release.

native:

  • Audit native template for blocking synchronous JS calls that delay SSP impression beacon execution.
  • Confirm SSP native asset render event (nativeImpression) is wired correctly in the publisher's native renderer implementation.

Status-specific steps:

Critical:

  • Verify GAM passback tag chain does not create circular redirect back to the same SSP line item.
  • Audit SSP tag macros in GAM using the GAM tag simulator; confirm all required macros resolve correctly before going live.

Rules

  1. Output JSON only — no preamble, no trailing text, no markdown fences.
  2. discrepancy_percentage must be computed exactly per the formula above, rounded to 2 decimal places.
  3. status must reflect the absolute discrepancy value per the threshold table.
  4. probable_causes must always include ≥ 2 universal causes plus all applicable format-specific and status-specific causes.
  5. For video format: probable_causes MUST contain at least one entry referencing "VPAID", "timeout", or "wrapper".
  6. For banner format with ssp_name containing "Prebid": probable_causes MUST contain at least one entry referencing "Prebid" or "timeout".
  7. recommended_investigation_steps must contain 4–6 entries, ordered from least to most invasive.
  8. All strings in arrays must be complete sentences, ≤ 60 words each.
  9. Tone: highly technical, objective, zero filler.

I/O Examples

Example 1 — Normal discrepancy, banner, AppNexus

Input:

{"gam_impressions":100000,"ssp_impressions":98000,"ad_format":"banner","ssp_name":"AppNexus"}

Output:

{
  "discrepancy_percentage": 2.00,
  "status": "Normal",
  "probable_causes": [
    "Timezone offset between GAM and AppNexus reporting windows causing boundary-period impression leakage.",
    "Network latency causing beacon loss: SSP fires impression pixel after GAM counts but before SSP confirms delivery.",
    "Ad blocker or browser privacy extension suppressing SSP pixel fire after GAM server-side count.",
    "Prebid.js auction timeout: SSP bid wins but creative renders after timeout window, causing SSP not to register impression.",
    "Header bidding key-value mismatch causing GAM to serve the Prebid line item while SSP records no delivery event."
  ],
  "recommended_investigation_steps": [
    "Align reporting windows: pull GAM and AppNexus reports for identical date range in UTC to eliminate timezone as variable.",
    "Compare impression counting methodology documentation for GAM vs AppNexus published counting spec.",
    "Export GAM Data Transfer files and cross-reference with AppNexus log-level data on a per-auction-ID basis.",
    "Check GAM discrepancy report under Delivery > Discrepancy to confirm if GAM has auto-flagged the gap.",
    "Set Prebid.js bidderTimeout to >= 3000ms in test environment and compare AppNexus impression capture rate before/after."
  ]
}

Example 2 — Critical discrepancy, video, SpotX

Input:

{"gam_impressions":50000,"ssp_impressions":30000,"ad_format":"video","ssp_name":"SpotX"}

Output:

{
  "discrepancy_percentage": 40.00,
  "status": "Critical",
  "probable_causes": [
    "Timezone offset between GAM and SpotX reporting windows causing boundary-period impression leakage.",
    "Network latency causing beacon loss: SSP fires impression pixel after GAM counts but before SSP confirms delivery.",
    "Ad blocker or browser privacy extension suppressing SSP pixel fire after GAM server-side count.",
    "VPAID wrapper timeout: VPAID container initializes but SpotX impression event fires after timeout threshold, dropping the count.",
    "VAST chain redirect latency: intermediate VAST wrapper hops exceed player timeout (typically 5s), causing SpotX not to register impression.",
    "IMA SDK buffering delay suppressing SSP impression beacon on slow connections.",
    "SSP passback loop misconfiguration: GAM fires SpotX tag, SSP returns passback to GAM creating double-count on GAM side.",
    "Macro substitution failure in SpotX tag (e.g., %%CLICK_URL_ESC%% not resolved), causing SSP to reject impression beacon."
  ],
  "recommended_investigation_steps": [
    "Align reporting windows: pull GAM and SpotX reports for identical date range in UTC to eliminate timezone as variable.",
    "Export GAM Data Transfer files and cross-reference with SpotX log-level data on a per-auction-ID basis.",
    "Pull VAST error log from GAM filtering error codes 301-304 for wrapper issues and 402-405 for timeout, cross-reference with SpotX VAST error report.",
    "Audit VPAID container timeout setting in player config and compare against SpotX-reported median VPAID init latency.",
    "Test VAST chain in VAST Inspector to count redirect hops and measure chain latency end-to-end.",
    "Verify GAM passback tag chain does not create circular redirect back to the same SpotX line item."
  ]
}

Example 3 — High discrepancy, banner, Prebid

Input:

{"gam_impressions":200000,"ssp_impressions":170000,"ad_format":"banner","ssp_name":"Prebid"}

Output:

{
  "discrepancy_percentage": 15.00,
  "status": "High",
  "probable_causes": [
    "Timezone offset between GAM and Prebid reporting windows causing boundary-period impression leakage.",
    "Network latency causing beacon loss: SSP fires impression pixel after GAM counts but before SSP confirms delivery.",
    "Prebid.js auction timeout (default 1000ms-3000ms): SSP bid wins but creative renders after timeout window, causing SSP not to register impression.",
    "Prebid adapter-level discrepancy: adapter fires win notification but SSP does not receive creative render confirmation.",
    "Header bidding key-value mismatch causing GAM to serve the Prebid line item while SSP records no delivery event.",
    "Partial cookie sync failure between GAM and Prebid SSP causing user-level deduplication gaps."
  ],
  "recommended_investigation_steps": [
    "Align reporting windows: pull GAM and Prebid reports for identical date range in UTC to eliminate timezone as variable.",
    "Compare impression counting methodology documentation for GAM vs Prebid published counting spec.",
    "Export GAM Data Transfer files and cross-reference with Prebid log-level data on a per-auction-ID basis.",
    "Set Prebid.js bidderTimeout to >= 3000ms in test environment and compare SSP impression capture rate before/after.",
    "Enable Prebid analytics adapter for the SSP in question and export bidWon vs adRenderFailed event counts.",
    "Verify SSP adapter version in Prebid.js bundle matches SSP latest certified adapter release."
  ]
}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.