forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prebid core: accept and propagate AD_RENDER_FAILED / AD_RENDER_SUCCEE…
…DED events from cross-origin ads This adds a new type of cross-origin message ('Prebid Event') to allow PUC and other cross-origin renderings to correctly report rendering result, and generates the appropriate events. Addresses prebid#7702 Related PUC changes: prebid/prebid-universal-creative#152 Documentation changes TBD
- Loading branch information
Showing
6 changed files
with
250 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {logError} from './utils.js'; | ||
import events from './events.js'; | ||
import CONSTANTS from './constants.json'; | ||
|
||
const {AD_RENDER_FAILED, AD_RENDER_SUCCEEDED} = CONSTANTS.EVENTS; | ||
|
||
export function emitAdRenderFail({ reason, message, bid, id }) { | ||
const data = { reason, message }; | ||
if (bid) data.bid = bid; | ||
if (id) data.adId = id; | ||
|
||
logError(message); | ||
events.emit(AD_RENDER_FAILED, data); | ||
} | ||
|
||
export function emitAdRenderSucceeded({ doc, bid, id }) { | ||
const data = { doc }; | ||
if (bid) data.bid = bid; | ||
if (id) data.adId = id; | ||
|
||
events.emit(AD_RENDER_SUCCEEDED, data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.