UNPKG

mk9-prebid

Version:

Header Bidding Management Library

204 lines (164 loc) 5.13 kB
``` Module Name: district m Bid Adapter Module Type: Bidder Adapter Maintainer: Steve Alliance (steve@districtm.net) ``` # Overview The `districtmDmxAdapter` module allows publishers to include DMX Exchange demand using Prebid 1.0+. ## Attributes * Single Request * Multi-Size Support * GDPR Compliant * CCPA Compliant * COPPA Compliant * Bids returned in **NET** ## Media Types * Banner * Video ## Bidder Parameters | Key | Scope | Type | Description | --- | --- | --- | --- | `dmxid` | Mandatory | Integer | Unique identifier of the placement, dmxid can be obtained in the district m Boost platform. | `memberid` | Mandatory | Integer | Unique identifier for your account, memberid can be obtained in the district m Boost platform. | `floor` | Optional | float | Most placement can have floor set in our platform, but this can now be set on the request too. # Ad Unit Configuration Example ```javascript var adUnits = [{ code: 'div-gpt-ad-1460505748561-0', mediaTypes: { banner: { sizes: [[300, 250], [300,600]], } }, bids: [{ bidder: 'districtmDMX', params: { dmxid: 100001, memberid: 100003 } }] }]; ``` # Ad Unit Configuration Example for video request ```javascript var videoAdUnit = { code: 'video1', sizes: [640,480], mediaTypes: { video: {context: 'instream', //or 'outstream' playerSize: [[640, 480]], skipppable: true, minduration: 5, maxduration: 45, playback_method: ['auto_play_sound_off', 'viewport_sound_off'], mimes: ["application/javascript", "video/mp4"], } }, bids: [ { bidder: 'districtmDMX', params: { dmxid: '100001', memberid: '100003', } } ] }; ``` # Ad Unit Configuration when COPPA is needed # Quick Start Guide ###### 1. Including the `districtmDmxAdapter` in your build process. Add the adapter as an argument to gulp build. ``` gulp build --modules=districtmDmxAdapter,ixBidAdapter,appnexusBidAdapter ``` *Adding `"districtmDmxAdapter"` as an entry in a JSON file with your bidders is also acceptable.* ``` [ "districtmDmxAdapter", "ixBidAdapter", "appnexusBidAdapter" ] ``` *Proceed to build with the JSON file.* ``` gulp build --modules=bidderModules.json ``` ###### 2. Configure the ad unit object Once Prebid is ready you may use the below example to create the adUnits object and begin building the configuration. ```javascript var adUnits = [{ code: 'div-gpt-ad-1460505748561-0', mediaTypes: { banner: { sizes: [[300, 250], [300, 600], [728, 90]], } }, bids: [] } ]; ``` ###### 3. Add the bidder Our demand and adapter supports multiple sizes per placement, as such a single dmxid may be used for all sizes of a single domain. ```javascript var adUnits = [{ code: 'div-gpt-ad-1460505748561-0', mediaTypes: { banner: { sizes: [[300, 250], [300, 600], [728, 90]], } }, bids: [{ bidder: 'districtmDMX', params: { dmxid: 100001, memberid: 100003 } }] }]; ``` Our bidder only supports instream context at the moment and we strongly like to put the media types and setting in the ad unit settings. If no value is set the default value will be applied. ```javascript var videoAdUnit = { code: 'video1', sizes: [640,480], mediaTypes: { video: {context: 'instream', //or 'outstream' playerSize: [[640, 480]], skipppable: true, minduration: 5, maxduration: 45, playback_method: ['auto_play_sound_off', 'viewport_sound_off'], mimes: ["application/javascript", "video/mp4"], } }, bids: [ { bidder: 'districtmDMX', params: { dmxid: '250258', memberid: '100600', } } ] }; ``` ###### 4. Implementation Checking Once the bidder is live in your Prebid configuration you may confirm it is making requests to our end point by looking for requests to `https://dmx.districtm.io/b/v1`. ###### 5. Setting first party data ```code pbjs.setConfig({ dmx: { user: { 'gender': 'M', 'yob': 1992, // keywords example 'keywords': 'automotive,dodge,engine,car' }, site: { cat: ['IAB-12'], pagecat: ['IAB-14'], sectioncat: ['IAB-24'] } } }); ```