code wiki / _hdl_build / nx_ad_view.nx
nx_ad_view.nx
buildroot/runtime/_hdl_build/nx_ad_view.nx
about
nx_ad_view.nx -- LIB (PURE, no I/O): honest VIEWPORT-VERIFIED impression counting for the "Brought
to you by" ad engine. Counts ONLY genuinely-SEEN impressions to the MRC standard (>=50% of an ad's
pixels in the viewable area for >=1 CONTINUOUS second display / >=2s video) -- NEVER served-but-
unseen. This is the "evidence & science, no fake impressions like Google/others" honesty law applied
to ad measurement: the named exceed axis vs incumbents' inflated serve-counts. Also records WHERE on
the page (slot class) so delivery placement is transparent. [bar: srch_adview.raw -- MRC viewability]
PRIVACY BY CONSTRUCTION: inputs are AGGREGATE buckets [viewed, slot, dwell_ms, n] -- NO visitor id,
IP, or fingerprint. The first-party client runtime measures 50%-in-viewport + continuous dwell and
posts only an aggregate bucket; this organ owns the COUNTING RULE (count iff viewed AND dwell>=min).
Mirrors nx_ad_botfilter's aggregate class-bucket shape -- "filter unseen" can never become "track
people". license_tier: ORIGINAL
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_ad_exceed.nxnx_ad_reach.nxnx_ad_view_gate.nx
structs
| none |
consts
| 15 | const AV_MIN_DISPLAY: i64 = 1000 // MRC: >=1 continuous second (display ads) [srch_adview.raw] |
| 16 | const AV_MIN_VIDEO: i64 = 2000 // MRC: >=2 continuous seconds (video ads) |
functions
| 22 | func av_viewable(viewed: i64, dwell_ms: i64, min_ms: i64) -> i64 |
| 31 | func av_tally(ev: *i64, m: i64, min_ms: i64, ovw: *i64, osv: *i64) -> i64 |
| 50 | func av_tally_slot(ev: *i64, m: i64, min_ms: i64, want_slot: i64) -> i64 |