Skip to content
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

Support userSync feature #12714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion modules/adgridBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,28 @@ function getBidData(bid) {
return bidData;
}

/**
* Register the user sync pixels/iframe which should be dropped after the auction.
*/
function getUserSyncs(syncOptions, response, gdprConsent, uspConsent) {
if (typeof response !== 'object' || response === null || response.length === 0) {
return [];
}

if (response[0]?.body?.ext?.cookies && response[0].body.ext.cookies === 'object') {
return response[0].body.ext.cookies.slice(0, 5);
} else {
return [];
}
};

export const spec = {
code: BIDDER.CODE,
isBidRequestValid,
buildRequests,
interpretResponse,
supportedMediaTypes: BIDDER.SUPPORTED_MEDIA_TYPES
supportedMediaTypes: BIDDER.SUPPORTED_MEDIA_TYPES,
getUserSyncs
};

registerBidder(spec);