Skip to content
40 changes: 32 additions & 8 deletions dev-docs/bidder-adapter-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const spec = {
isBidRequestValid: function(bid) {},
buildRequests: function(validBidRequests[]) {},
interpretResponse: function(serverResponse, request) {},
getUserSyncs: function(syncOptions) {}
getUserSyncs: function(syncOptions, serverResponses) {}
}
registerBidder(spec);

Expand Down Expand Up @@ -287,13 +287,21 @@ All user ID sync activity must be done in one of two ways:
{% highlight js %}

{
getUserSyncs: function(syncOptions) {
getUserSyncs: function(syncOptions, serverResponses) {
const syncs = []
if (syncOptions.iframeEnabled) {
return [{
syncs.push({
type: 'iframe',
url: '//acdn.adnxs.com/ib/static/usersync/v3/async_usersync.html'
}];
});
}
if (syncOptions.pixelEnabled && serverResponses.length > 0) {
syncs.push({
type: 'image',
url: serverResponses[0].body.userSync.url
});
}
return syncs;
}
}

Expand Down Expand Up @@ -465,13 +473,29 @@ export const spec = {
};
return bidResponses;
},
getUserSyncs: function(syncOptions) {

/**
* Register the user sync pixels which should be dropped after the auction.
*
* @param {SyncOptions} syncOptions Which user syncs are allowed?
* @param {ServerResponse[]} serverResponses List of server's responses.
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: function(syncOptions, serverResponses) {
const syncs = []
if (syncOptions.iframeEnabled) {
return [{
syncs.push({
type: 'iframe',
url: 'ADAPTER_SYNC_URL'
}];
url: '//acdn.adnxs.com/ib/static/usersync/v3/async_usersync.html'
});
}
if (syncOptions.pixelEnabled && serverResponses.length > 0) {
syncs.push({
type: 'image',
url: serverResponses[0].body.userSync.url
});
}
return syncs;
}
}
registerBidder(spec);
Expand Down