Conversation
e6e0eea to
5dd369a
Compare
ef6c5c1 to
b109fc2
Compare
src/native.js
Outdated
| /* | ||
| * Create an invisible pixel | ||
| */ | ||
| function createImpressionPixel(src) { |
There was a problem hiding this comment.
this code should be in utils now (might have to rebase to get it)
src/adapters/appnexusAst.js
Outdated
|
|
||
| // map standard native asset identifier to what /ut expects | ||
| Object.keys(bid.nativeParams).forEach(key => { | ||
| let requestKey = NATIVE_MAPPING[key] && NATIVE_MAPPING[key].serverName || NATIVE_MAPPING[key] || key; |
There was a problem hiding this comment.
This code is a bit confusing. Why is this mapping required?
There was a problem hiding this comment.
It's required because some of the standard native assets prebid defines don't translate exactly to v3 endpoint parameters. v3 looks for description request parameter rather than body for example. Agreed this code is confusing though, I'll refactor to be more clear
src/native.js
Outdated
| /* | ||
| * Append to head | ||
| */ | ||
| function attachPixel(pixel) { |
src/prebid.js
Outdated
|
|
||
| // for native-enabled adUnits, only request bids if all bidders support native | ||
| // TODO: abstract this and the video adunit validation into general adunit validation function | ||
| const invalidNativeAdUnits = adUnits.filter(nativeAdUnit).filter(hasNonNativeBidder); |
There was a problem hiding this comment.
We should still fire requests for bidders that support native.
| import { getBidRequest, logError } from './utils'; | ||
|
|
||
| /** INSERT NATIVE ADAPTERS - DO NOT EDIT OR REMOVE */ | ||
| const nativeAdapters = []; |
There was a problem hiding this comment.
Probably don't want this line in between these 2.
There was a problem hiding this comment.
This is to prevent a linting error 'nativeAdapters' is not defined
|
|
||
| /** INSERT NATIVE ADAPTERS - DO NOT EDIT OR REMOVE */ | ||
| const nativeAdapters = []; | ||
| /** END INSERT NATIVE ADAPTERS */ |
There was a problem hiding this comment.
The adapter registration has to go into this file? seems inconsistent.
There was a problem hiding this comment.
Writing it to adaptermanager.js like the other loader does causes a circular dependency. Can move it though if there's another place that makes more sense
1abf194 to
6e631e7
Compare
d0a8d9b to
7e4b136
Compare
f1e1e47 to
2a21434
Compare
…built * 'master' of https://github.com/prebid/Prebid.js: (23 commits) Increment pre version Probed 0.24.0 Release Beachfront adapter - add ad unit size (prebid#1183) Thoughtleadr adapter - fix postMessage (prebid#1207) When prebid server issues a no-bid response, call addBidResponse for every adUnit requested (prebid#1204) Improvement/timeout xhr (prebid#1172) Add native support (prebid#1072) Improvement/alias queue (prebid#1156) Updated documentaion (prebid#1160) Improvement/prebid iframes amp pages (prebid#1119) Fixes prebid#1114 possible xss issue (prebid#1186) Allowed setTargetingForGPTAsync() to target specific ad unit codes. (prebid#1158) updated tag (prebid#1212) Common user-sync (prebid#1144) Rename secureCreatives file and lint (prebid#1203) HIRO Media: Remove batching mechanism and use AJAX instead of JSONP (prebid#1133) Add Support for DigiTrust in Rubicon Adapter (prebid#1201) Upgrade linters to ESLint with stricter code style (prebid#1111) Add dynamic bidfloor parameter to Smart Adserver Adapter (prebid#1194) Bug fix: bids served by secure creatives does not get pushed into _winningBids (prebid#1192) ...
….23.0 to aolgithub-master * commit '136fc37637749a764070c35c03e7e87a5c157947': (33 commits) Added changelog entry. Implemented passing key values feature. Update code to ESlint rules. Prebid 0.24.1 Release tests: drop ie9 browserstack test Audience Network: separate size from format (prebid#1218) Bugfix/target filtering api fix (prebid#1220) Map sponsor request param to endpoint param (prebid#1219) Increment pre version Probed 0.24.0 Release Beachfront adapter - add ad unit size (prebid#1183) Thoughtleadr adapter - fix postMessage (prebid#1207) When prebid server issues a no-bid response, call addBidResponse for every adUnit requested (prebid#1204) Improvement/timeout xhr (prebid#1172) Add native support (prebid#1072) Improvement/alias queue (prebid#1156) Updated documentaion (prebid#1160) Improvement/prebid iframes amp pages (prebid#1119) Fixes prebid#1114 possible xss issue (prebid#1186) Allowed setTargetingForGPTAsync() to target specific ad unit codes. (prebid#1158) ...
A native advertisement comprises a set of assets--a title, a description, and an image url, for example--that are plugged into a publisher-defined HTML template. The template includes placeholder macros for those assets, and may be styled to match the form of the surrounding page. This change adds capabilities for requesting native demand from bidder adapters, and sending the received assets to a native template defined in an ad server via key-value targeting.
Publisher Setup
To signal a native demand request, configure an adUnit's
mediaTypeto'native'.Optionally specify the individual assets to request from the demand partner with a
nativeParamsobject. This object will be passed to bidder adapters for use in constructing their network requests. The possiblenativeParamsareAny field in
nativeParamsconfigured as{required: true}will be required on the bid response object. If not present, the bid is not added to the auction.Prebid also has a pre-defined native type,
image, which is an abstraction over a set of commonly requested native assets. This expands to the following set of native parametersUse this by setting
nativeParamstotype: 'image'.Example native ad unit
Bidder Adapter Setup
The adapter is given the
nativeParamsobject in its callBids function and may send these parameters directly or transform them to fit their endpoint's expected parameters. For example, the appnexusAst endpoint recognizestitleandiconas native asset request parameters and passes those on directly, but expectsdescriptioninstead ofbodyand creates a mapping between these identifiers.When demand is returned to the adapter, it should mark the bid response object with
mediaType: 'native', and attach the received assets to anativeobject on the bid with properties that match thenativeParamsidentifiers. For example, an adapter might construct its native bid response object in its response handler function as followsAd Server Setup
Once the bid response object has all its required native properties set, if it wins the auction, targeting keys are set thusly:
Toggling
pbjs.enableSendAllBids()will also set landscape targeting for these native assets. Due to DFPs 20 character limit, the full bidder code appendix for these keys may be truncated.A publisher's ad server should contain a template with macros for these keys, for example
Additionally, this snippet can be added to a template to call back to prebid.js to fire impression trackers for the winning native bid
closes #1012