Expose completion state, raw data and page-supplied evidence on the fod object - #15
Open
YaroslavVlasenko wants to merge 3 commits into
Open
Expose completion state, raw data and page-supplied evidence on the fod object#15YaroslavVlasenko wants to merge 3 commits into
YaroslavVlasenko wants to merge 3 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two additions to the JavaScript template:
fod) now exposes two public properties alongside the existingcomplete()/onChange()API:isComplete:falsewhile evidence collection is in flight,trueonce processing has finished (successfully or not; seedata.errors).data: the latest raw JSON payload. Unlike the property getters it keeps missing values asnullinstead of the null-reason text.<ObjectName>Evidence(defaultfodEvidence) before the script executes. Each entry is url-encoded and appended to the form-data body of the existing POST request. The values are never written to the URL, cookies or web storage, so this is the supported way to pass sensitive evidence.Both are documented in the README.
Why
This lets an on-page 51Degrees integration share its result with other consumers. The first consumer is the Prebid.js 51Degrees RTD module: it detects
fodon the page automatically and enriches the bid request from it instead of loading a second copy of the script.The evidence object gives pages a way to pass evidence that must not appear in a URL or persist in the browser.
Without
<ObjectName>Evidenceon the page the generated script behaves exactly as before.