Skip to content

Commit

Permalink
enhance debugging module examples (#5203)
Browse files Browse the repository at this point in the history
* enhance debugging module examples

* Update debugging.md

* lint
  • Loading branch information
bretg authored Mar 13, 2024
1 parent 6b0dd9d commit cf6c31d
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion dev-docs/modules/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ pbjs.setConfig({
intercept: [
{
when: {
// intercept all bids that have adUnitCode === 'test-div'
// intercept bids from bidderA that have adUnitCode === 'test-div'
adUnitCode: 'test-div',
bidder: 'bidderA'
},
then: {
// mock their response with sane defaults and `cpm: 10`
Expand Down Expand Up @@ -155,3 +156,34 @@ To illustrate, the following definitions are equivalent:
|Property |Type |Default value |Description |
|---------+------------------+--------------+------------------------------------------------------------------------------------------------------------------------|
|`delay` |Number |0 |Delay (in milliseconds) before intercepted bids are injected into the auction. Can be used to simulate network latency. |

## Examples

### Force a video bid

```javascript
pbjs.setConfig({
debugging: {
enabled: true,
intercept: [
{
when: {
adUnitCode: "video-adunit",
bidder: "bidderA'
},
then: {
cpm: 10,
mediaType: "video",
source: "client",
currency: "SEK",
cpm: 50.00,
creativeId: "11111",
width: 640,
height: 360,
vastXml: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><VAST version=\"2.0\"><Ad id=\"TestAd\"><InLine><AdSystem>Prebid Test</AdSystem><AdTitle>VAST 2.0 Linear Ad</AdTitle><Error><![CDATA[http://myErrorURL/error]]></Error><Impression><![CDATA[]]></Impression><Creatives><Creative id=\"2014\" AdID=\"20150911\" sequence=\"1\"><Linear><Duration>00:00:15</Duration><TrackingEvents><Tracking event=\"creativeView\"><![CDATA[]]></Tracking><Tracking event=\"start\"><![CDATA[]]></Tracking><Tracking event=\"firstQuartile\"><![CDATA[]]></Tracking><Tracking event=\"midpoint\"><![CDATA[]]></Tracking><Tracking event=\"thirdQuartile\"><![CDATA[]]></Tracking><Tracking event=\"complete\"><![CDATA[]]></Tracking></TrackingEvents><VideoClicks><ClickThrough><![CDATA[http://prebid.org/]]></ClickThrough><ClickTracking><![CDATA[]]></ClickTracking></VideoClicks><MediaFiles><MediaFile delivery=\"progressive\" width=\"960\" height=\"540\" type=\"video/mp4\"><![CDATA[https://s3.amazonaws.com/files.prebid.org/creatives/PrebidLogo.mp4]]></MediaFile></MediaFiles></Linear></Creative></Creatives></InLine></Ad></VAST>"
}
},
]
}
});
```

0 comments on commit cf6c31d

Please sign in to comment.