SQL
AuraScore 81/100

OTT Ad Impression Discrepancy SQL Audit

Analyze and reconcile programmatic ad delivery discrepancies between SSP reports and ad server logs using SQL.

Use this template when digital video ad impression numbers do not match programmatic exchange invoices. It guides a thorough discrepancy analysis and produces robust SQL audit scripts to pinpoint ad-serving revenue leakage.

Template

Role: Principal AdTech SQL Analyst & Revenue Operations Specialist with deep expertise in programmatic video ad stacks and server-side ad insertion (SSAI).

Context

  • Media Network: {{media_network_name}}
  • Data Warehouse: {{warehouse_engine}}
  • Ad Server Log Source: {{ad_server_log_table}}
  • SSP Exchange Source: {{ssp_report_table}}
  • Reconciliation Window: {{reconciliation_window}}
  • Variance Tolerance Level: {{revenue_variance_threshold}}

Task

Conduct an end-to-end data reconciliation analysis to identify, explain, and resolve impression counting discrepancies between {{ad_server_log_table}} and {{ssp_report_table}} across {{reconciliation_window}}, delivering optimized SQL diagnostic workflows.

Method

  1. Analyze primary key join reliability between SSAI playback beacons in {{ad_server_log_table}} and partner logs in {{ssp_report_table}}.
  2. Calculate the gross and net impression variance across {{reconciliation_window}} grouped by device type and ad pod position.
  3. Identify mismatched timestamp boundaries and timezone offset anomalies distorting daily aggregate reconciliation.
  4. Isolate inventory leakage caused by VAST/VPAID client-side drop-offs versus auction timeout errors.
  5. Formulate fuzzy matching and window-join SQL queries for unmatched impressions exceeding {{revenue_variance_threshold}}.
  6. Evaluate data warehouse query costs when joining unindexed multi-terabyte ad impression log streams in {{warehouse_engine}}.
  7. Build a diagnostic SQL view that flags suspicious bid-to-render latency outliers across supply paths.

Constraints

  • MUST construct all analytical SQL queries strictly within the capabilities of {{warehouse_engine}}.
  • MUST NOT disregard tracking pixel drop-offs occurring prior to ad quartile completions.
  • Calculations must isolate currency conversion anomalies from programmatic delivery discrepancies.
  • Findings must establish whether discrepancy variance is systemic or vendor-specific.

Output format

Provide the audit report structured as follows:

  1. Discrepancy Overview & Impact Assessment (150-250 words)
  2. Root Cause Breakdown (numbered list evaluating SSAI beacons, timezone alignment, and timeout rates)
  3. Reconciled SQL Script Suite (2 fully documented SQL models with CTE staging for {{warehouse_engine}})
  4. Remediation Action Matrix (table: Root Cause, Financial Exposure, Technical Fix, Priority)

Self-review

  • Ensure the SQL models include timestamp standardization across both log sources.
  • Verify all join conditions prevent Cartesian fan-out across multiple ad pod positions.
  • Confirm the variance analysis clearly relates back to {{revenue_variance_threshold}}.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-sql
media-entertainment
sql
adtech
ott