[Question] criteo id issue
Type of issue
Question
Description
I have the impression the criteo id is not properly transmitted to the adapter I'm building.
Here is a screenshot of my Network panel:

The red line is the call to my server, which is apparently failing because the criteo ID is wrong.
However, we can notice this red request is performed BEFORE we actually get the criteo ID (which is given by the second sid?.. request) whereas my buildRequest function need it.
What am I doing wrong? Below are my codes:
// missenaBidAdapter.js
import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'missena';
const ENDPOINT_URL = 'https://mysuperurl.com/';
export const spec = {
code: BIDDER_CODE,
aliases: [BIDDER_CODE], // short code
isBidRequestValid: function (bid) {
return true;//for testing purpose only :)
},
buildRequests: function (validBidRequests) {
const req = validBidRequests[0];
const apiKey = req.params.apiKey;
const criteoId = req.userId.criteoId;
return validBidRequests.map((bidRequest) => {
return {
method: 'POST',
url: ENDPOINT_URL + '?' + utils.formatQS({t: apiKey}),
data: JSON.stringify({requestId: bidRequest.bidId, criteoId: criteoId}),
};
});
},
interpretResponse: function (serverResponse, bidRequest) {
return serverResponse.body;
},
getUserSyncs: function (syncOptions) {
if (syncOptions.iframeEnabled) {
return [{
type: 'iframe',
url: 'https://acdn.adnxs.com/dmp/async_usersync.html'
}];
}
},
};
registerBidder(spec);
And the client code to test:
<html>
<head>
<script src="../../build/dev/prebid.js" async></script>
<script>
const FAILSAFE_TIMEOUT = 2000;
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function () {
pbjs.setConfig({
debug: true,
userSync: {
userIds: [
{
name: "criteo",
},
],
syncDelay: 5000,
auctionDelay: 1000,
},
});
console.log("*** user ids:", pbjs.getUserIds());
pbjs.addAdUnits([
{
code: "test-div",
mediaTypes: {
banner: {
sizes: [
[300, 250],
[300, 600],
[728, 90],
],
},
},
bids: [
{
bidder: "missena",
params: {
apiKey: "00000000-0000-0000-0000-000000000001",
},
},
],
},
]);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
});
});
function sendAdserverRequest(bidResponses) {
if (pbjs.adserverRequestSent) return;
var winner = pbjs.getAdserverTargetingForAdUnitCode(
"missena-ad-unit-code"
);
var sspWinner = winner["hb_bidder"];
var cpm = parseFloat(winner["hb_pb"]);
console.log("winner : ", sspWinner, ", at that price : ", cpm, winner);
var iframe = document.getElementById("div-1");
if (winner && winner["hb_adid"]) {
iframe.parentElement.style.position = "relative";
iframe.style.display = "block";
pbjs.renderAd(iframe.contentDocument, winner["hb_adid"]);
}
}
setTimeout(function () {
sendAdserverRequest();
}, FAILSAFE_TIMEOUT);
</script>
<script></script>
</head>
<body>
<h2>Rubicon Project Prebid</h2>
<iframe id="div-1"></iframe>
</body>
</html>
hi @sebbes-at-missena thanks for bringing this up, your Criteo representatives will reach you out to help
Thaks @allanjun .
I close because we indeed have discussed with Criteo.