You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// handle this script from native template in an ad server// window.parent.postMessage(JSON.stringify({// message: 'Prebid Native',// adId: '%%PATTERN:hb_adid%%'// }), '*');if(adObject&&data.message==='Prebid Native'){if(data.action==='assetRequest'){constmessage=getAssetMessage(data,adObject);ev.source.postMessage(JSON.stringify(message),ev.origin);return;}elseif(data.action==='allAssetRequest'){constmessage=getAllAssetsMessage(data,adObject);ev.source.postMessage(JSON.stringify(message),ev.origin);}elseif(data.action==='resizeNativeHeight'){adObject.height=data.height;adObject.width=data.width;resizeRemoteCreative(adObject);}consttrackerType=fireNativeTrackers(data,adObject);if(trackerType==='click'){return;}auctionManager.addWinningBid(adObject);events.emit(BID_WON,adObject);}}}```
The text was updated successfully, but these errors were encountered:
@gpolaert Thanks for reporting this issue. I managed to replicate it. It's not only bidWon that is fired multiple times, also impression tracker is fired multiple times. I opened PR to fix the issue.
Type of issue
Issue (non-blocking)
Description
Duplicate bidWon event fired when the native and universal-creative render are used
Steps to reproduce
Set the following code
Test page
Expected results
An array with the bid that have been rendered using =>
pbjs. getAllWinningBids()
Actual results
An array with 2 time the same bid duplicated =>
pbjs. getAllWinningBids()
Platform details
Other information
This issue is due to the universal creative will post (postMessage) 2 events :
But it seems a
return
is missing in that code.So the 2 messages fired a bidWon event.
I think the bug is true also when resizeNativeHeight occured too
https://github.com/prebid/Prebid.js/blob/master/src/secureCreatives.js#L54-L80
The text was updated successfully, but these errors were encountered: