Skip to content

Commit

Permalink
Read placementId from response and add tracking informations
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Souche committed Jul 3, 2019
1 parent b02a00c commit e03020f
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 16,314 deletions.
25 changes: 21 additions & 4 deletions modules/teadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export const spec = {
const payload = {
referrer: getReferrerInfo(bidderRequest),
data: bids,
deviceWidth: screen.width
deviceWidth: screen.width,
hb_version: '$prebid.version$'
};

let gdpr = bidderRequest.gdprConsent;
Expand Down Expand Up @@ -84,19 +85,35 @@ export const spec = {
ttl: bid.ttl,
ad: bid.ad,
requestId: bid.bidId,
creativeId: bid.creativeId
creativeId: bid.creativeId,
placementId: bid.placementId
};
bidResponses.push(bidResponse);
});
}
return bidResponses;
},

getUserSyncs: function(syncOptions, responses, gdprApplies) {
getUserSyncs: function(syncOptions, responses, gdprConsent) {
let gdprIab = {
status: findGdprStatus(gdprConsent.gdprApplies, gdprConsent.vendorData),
consent: gdprConsent.consentString
};

let queryParams = {
hb_provider: 'prebid',
hb_version: '$prebid.version$',
gdprIab: JSON.stringify(gdprIab)
};

if (utils.deepAccess(responses[0], 'body.responses.0.placementId')) {
queryParams.placementId = responses[0].body.responses[0].placementId
};

if (syncOptions.iframeEnabled) {
return [{
type: 'iframe',
url: '//sync.teads.tv/iframe'
url: '//sync.teads.tv/iframe?' + utils.parseQueryStringParameters(queryParams)
}];
}
}
Expand Down
Loading

0 comments on commit e03020f

Please sign in to comment.