Skip to content

Commit

Permalink
appnexus bid adapter - update impression urls logic (prebid#7618)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and Chris Pabst committed Jan 10, 2022
1 parent 41abb4c commit 41b4794
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,11 @@ function newBid(serverBid, rtbBid, bidderRequest) {
});
try {
if (rtbBid.rtb.trackers) {
const url = rtbBid.rtb.trackers[0].impression_urls[0];
const tracker = createTrackPixelHtml(url);
bid.ad += tracker;
for (let i = 0; i < rtbBid.rtb.trackers[0].impression_urls.length; i++) {
const url = rtbBid.rtb.trackers[0].impression_urls[i];
const tracker = createTrackPixelHtml(url);
bid.ad += tracker;
}
}
} catch (error) {
logError('Error appending tracking pixel', error);
Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,8 @@ describe('AppNexusAdapter', function () {
'trackers': [
{
'impression_urls': [
'https://lax1-ib.adnxs.com/impression'
'https://lax1-ib.adnxs.com/impression',
'https://www.test.com/tracker'
],
'video_events': {}
}
Expand Down

0 comments on commit 41b4794

Please sign in to comment.