From 6348a6bc4550b1c3237349c3c88b2cebe0443098 Mon Sep 17 00:00:00 2001 From: bretg Date: Fri, 19 Jul 2024 15:39:58 -0400 Subject: [PATCH] debugging module: added native example (#5510) * debugging module: added native example * lint --- dev-docs/modules/debugging.md | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/dev-docs/modules/debugging.md b/dev-docs/modules/debugging.md index 2e2d954d56..0f2d00cce5 100644 --- a/dev-docs/modules/debugging.md +++ b/dev-docs/modules/debugging.md @@ -10,6 +10,10 @@ sidebarType : 1 --- # Debugging module +{: .no_toc} + +- TOC +{:toc } This module allows to "intercept" bids and replace their contents with arbitrary data for the purposes of testing and development. @@ -187,3 +191,57 @@ pbjs.setConfig({ } }); ``` + +### Force a Native Bid + +Note: the native response asset IDs and types must match the request. + +```javascript +pbjs.setConfig({ + debugging: { + enabled: true, + intercept: [ + { + when: { + adUnitCode: "test-div", + bidder: "bidderA" + }, + then: { + cpm: 10, + bidder: "bidderA", + mediaType: "native", + source: "client", + currency: "EUR", + cpm: 1.00, + creativeId: "222222", + native: { ortb: { + link: { url: "http://example.com" }, + assets: [{ + id: 1, + title: { text: "Test Native Creative" } + },{ + id: 2, + data: { + type: 2, + value: "Test Description" + } + },{ + id: 3, + img: { + type: 3, + url: "https://files.prebid.org/creatives/prebid300x250.png" + } + },{ + id: 4, + data: { + type: 1, + value: "Prebid" + } + }] + }} + } + } + ] + } +}); +```