Adgeneration: Rewrite adapter to match Prebid.js v1.6.6 spec#11
Open
ss-toshihide-tajima wants to merge 4 commits into
Open
Adgeneration: Rewrite adapter to match Prebid.js v1.6.6 spec#11ss-toshihide-tajima wants to merge 4 commits into
ss-toshihide-tajima wants to merge 4 commits into
Conversation
Send ortb body as JSON POST to /adgen/prebid (was GET /adsv/v1 with URL params),
matching the current Prebid.js adgenerationBidAdapter implementation.
- Endpoint: GET /adsv/v1 -> POST /adgen/prebid (JSON body)
- Add Native mediaType support for app/site
- Read bid from results[0] (was response body root)
- Drop OS-based sdktype branching (fixed to sdktype=0)
- Drop idfa/advertising_id query params (consolidated into device.ifa)
- wrapNativeAdm: handle both {"native":{...}} and {assets:...} responses
- Add ADGBrowserMTag, location_params/upper_billboard handling
- Rewrite unit tests (10 tests pass)
- TestJsonSamples is t.Skip pending golden file rewrite
- Rewrite adgenerationtest/exemplary/ and supplemental/ to the new POST /adgen/prebid request shape (uri/body/headers/impIDs) - Update supplemental error cases to use expectedMakeBidsErrors - Enable TestJsonSamples (was t.Skip), now exercises full MakeRequests + MakeBids round-trip against the regenerated samples
- Bump adapterver 1.0.3 -> 1.6.6 so Prebid.js / Prebid Server send the
same ADG protocol version (sdkname still distinguishes the two)
- Native: append adResult.beaconurl to native.imptrackers in the AdM
JSON to match createNativeAd() in adgenerationBidAdapter.js, and
handle both {"native":{...}} and {assets:...} payload shapes
- ADGBrowserM: read marginTop from imp.ext.bidder.marginTop
(ExtImpAdgeneration.MarginTop) instead of hardcoding '0'; fall back
to '0' when unset, mirroring Prebid.js behavior
- Add bidder-params schema entry for marginTop
- Add unit tests covering the new ADGBrowserM marginTop wiring,
beaconurl appending, deduplication, and wrapped native input
- Regenerate golden file adapterver fields to 1.6.6
- Replace JS-style regex literal `/\r?\n/g` with Go-native `\r?\n` so vastxml line breaks are actually stripped before being interpolated into <script> string literals (APV and ADGBrowserM paths) - getCurrency() now mirrors Prebid.js getCurrencyType(): return "USD" iff request.Cur contains USD (case-insensitive), else "JPY". Drop the previous JPY-preferred / first-fallback behavior that could leak EUR/GBP downstream - MakeBids: resolve target imp from the body we sent (externalRequest.Body -> ortb.imp[0].id) instead of bidResp.locationid, matching Prebid.js' bidRequests.data.ortb.imp[0]; this also recovers bids when the backend omits locationid - buildAdMarkup: fall back to banner when adResult.native is present but assets[] is empty/missing, mirroring Prebid.js isNative() - Add regression tests: vastxml newline stripping (APV/ADGBrowserM), USD/JPY parity cases, and native-without-assets fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
adgenerationBidAdapterに仕様を合わせ、adgenerationアダプターを書き換えGET /adsv/v1(URL クエリ) からPOST /adgen/prebid(ortb JSON body) に変更主な変更
https://d.socdm.com/adsv/v1→https://d.socdm.com/adgen/prebidstatic/bidder-info/adgeneration.yamlの capability にnativeを追加 (app / site 両方)results[0]優先 (prebid.js 実装と一致)0固定 (prebid.js パリティ優先)device.ifaに集約wrapNativeAdmで{"native":{...}}と{assets:...}の両形式を吸収 (バックエンド応答形式未確定のため両対応)ADomain(旧adomain)、location_params/upper_billboard判定、ADGBrowserMTagを追加残作業
adapters/adgeneration/adgenerationtest/配下の JSON golden file (exemplary / supplemental) は旧 GET 形式のまま。TestJsonSamplesはt.Skipで退避中。POST + JSON body 形式への書き換えが別途必要d.socdm.com/adgen/prebid) がsdkname=prebidserverのリクエストを受けてresults[]形式で応答できるか要確認sdktype=0固定で app 配信のバックエンド処理に影響がないか要確認背景
adgenerationアダプターを Prebid.js 版と揃える施策projects/prebid-server/research/parity-concerns.md(社内資料)Test plan
go build ./...通過go test ./adapters/adgeneration/...通過 (10 件、TestJsonSamplesは Skip)TestJsonSamplesを有効化して通過確認/adgen/prebid仕様確認後、ステージングで疎通確認