diff --git a/nas.js b/nas.js index 6e0685c..b012f0f 100644 --- a/nas.js +++ b/nas.js @@ -43,8 +43,11 @@ function impressionsPerCredit(type) { return type === 'banner' ? 5 : type === 'text' ? 10 : type === 'video' ? 0 : 0; } function nasKind(type) { - if (type === 'banner') return { pid: 2, adtype: 'banner' }; - if (type === 'text') return { pid: 1, adtype: 'text' }; + // pid encodes text(1)/banner(2); adtype is a separate small int — 1 is the + // value the overwhelming majority of live NAS rows use for both formats. + const adtype = Number(process.env.NAS_ADTYPE || 1); + if (type === 'banner') return { pid: 2, adtype }; + if (type === 'text') return { pid: 1, adtype }; return null; // only banner/text syndicate to NAS in v1 (login/solo/video are IAP-native) }