-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New PAAPI module: topLevelPaapi #11379
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
854afb5
refactor size logic
dgirardi 60159d2
fill in requestedSize on auction configs
dgirardi 5650e3e
topLevelPaapi
dgirardi 365802c
WIP
dgirardi 457accc
getPAAPIBids
dgirardi 42f7abd
include size in paapi bids
dgirardi c1ba3a1
update TL example
dgirardi bfbfd1d
Merge branch 'master' into paapi-tls-improve
dgirardi 82f72fe
slightly nicer example
dgirardi 3200b11
slight improvement
dgirardi 1c594f8
refactor
dgirardi ac43f5b
add PAAPI_ERROR event
dgirardi ff72e38
use optable in TL example
dgirardi 5db17b9
allow async bid retrieval on render: safeframes
dgirardi f390f45
allow async bid retrieval on render: renderAd
dgirardi c94413f
do not force string on requestedSize
dgirardi 914cc14
support rendering of paapi bids
dgirardi d25db1e
include auctionConfig in events
dgirardi 77e5c2d
fix tests
dgirardi a9ce33d
overrideWinner; autorun by default
dgirardi 6b57c9d
autorun & overrideWinner
dgirardi 5f37d8f
Merge branch 'master' into paapi-tls-improve
dgirardi 1f2b752
fix tests
dgirardi d6bd7b0
emit BID_WON for paapi bids
dgirardi 319345c
add no ad server example
dgirardi 361068c
improve bid override logic
dgirardi 807db56
Merge branch 'master' into paapi-tls-improve
dgirardi 07c9ff3
fix lint
dgirardi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
188 changes: 0 additions & 188 deletions
188
integrationExamples/gpt/top-level-paapi/tl_paapi_example.html
This file was deleted.
Oops, something went wrong.
134 changes: 134 additions & 0 deletions
134
integrationExamples/top-level-paapi/gam-contextual.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<html xmlns="http://www.w3.org/1999/html"> | ||
<head> | ||
<script src="shared/example-setup.js"></script> | ||
<script src="../../build/dev/prebid.js"></script> | ||
|
||
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> | ||
|
||
<script> | ||
var FAILSAFE_TIMEOUT = 3300; | ||
var PREBID_TIMEOUT = 3000; | ||
var adUnits = [{ | ||
code: 'div-1', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250]], | ||
} | ||
}, | ||
ortb2Imp: { | ||
ext: { | ||
ae: 1 | ||
} | ||
}, | ||
bids: [ | ||
{ | ||
bidder: 'optable', | ||
params: { | ||
site: 'daa30ba1-5613-4a2c-b7f0-34e2c033202a' | ||
}, | ||
}, | ||
{ | ||
bidder: 'contextual', | ||
params: { | ||
site: 'daa30ba1-5613-4a2c-b7f0-34e2c033202a' | ||
} | ||
} | ||
], | ||
} | ||
] | ||
; | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
googletag.cmd.push(function () { | ||
googletag.pubads().disableInitialLoad(); | ||
}); | ||
|
||
pbjs.que.push(function () { | ||
pbjs.setConfig({ | ||
debug: true, | ||
paapi: { | ||
enabled: true, | ||
gpt: { | ||
autoconfig: false | ||
}, | ||
topLevelSeller: { | ||
auctionConfig: { | ||
seller: window.location.origin, | ||
decisionLogicURL: new URL('shared/decisionLogic.js', window.location).toString(), | ||
}, | ||
overrideWinner: true | ||
} | ||
}, | ||
}); | ||
|
||
pbjs.addAdUnits(adUnits); | ||
requestBids(); | ||
}); | ||
|
||
function requestBids() { | ||
pbjs.adserverRequestSent = false; | ||
pbjs.requestBids({ | ||
bidsBackHandler: sendAdserverRequest, | ||
timeout: PREBID_TIMEOUT | ||
}); | ||
} | ||
|
||
function sendAdserverRequest() { | ||
if (pbjs.adserverRequestSent) return; | ||
pbjs.adserverRequestSent = true; | ||
googletag.cmd.push(function () { | ||
pbjs.que.push(function () { | ||
pbjs.setTargetingForGPTAsync(); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
} | ||
|
||
setTimeout(function () { | ||
sendAdserverRequest(); | ||
}, FAILSAFE_TIMEOUT); | ||
|
||
googletag.cmd.push(function () { | ||
googletag.defineSlot('/41758329/integ-test', [[300, 250], [300, 600]], 'div-1').setTargeting('creative', 'banner-safeframe').addService(googletag.pubads()); | ||
|
||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<h2>GAM contextual + Publisher as top level PAAPI seller example</h2> | ||
|
||
<p> | ||
This example starts PAAPI auctions at the same time as GAM targeting. The flow is | ||
similar to a typical GAM auction, but if Prebid wins, and got a | ||
PAAPI bid, it is rendered instead of the contextual bid. | ||
</p> | ||
<div id="controls"> | ||
<script>addExampleControls(requestBids)</script> | ||
</div> | ||
<h5>Div-1</h5> | ||
<div id="div-1" style='min-width: 300px; min-height: 250px;'> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function () { | ||
googletag.display('div-1'); | ||
}); | ||
</script> | ||
</div> | ||
<div style="margin-top: 20px"> | ||
<h2>Instructions</h2> | ||
<p>Start local server with:</p> | ||
<code>gulp serve-fast --https</code> | ||
<p>Chrome flags:</p> | ||
<code>--enable-features=CookieDeprecationFacilitatedTesting:label/treatment_1.2/force_eligible/true | ||
--privacy-sandbox-enrollment-overrides=https://localhost:9999</code> | ||
<p>Join interest group at <a href="https://www.optable.co/">https://www.optable.co/</a> | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this would mean, if pbjs has a tls pa winner, go with that instead of a possble gam contextual winner? right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - depending on what you mean by GAM contextual winner. It means that when Prebid is asked to render a contextual ("normal") bid, it will instead render a PAAPI winning bid if it has one for the slot.
In the typical GAM flow (at least typical in our examples, including this one) the bid that is potentially replaced is the Prebid bid that won the Prebid auction, and then the GAM auction, to be replaced by the winner of the PAAPI auction.