-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AD-963] Add documentation for JW Player RTD Provider #2427
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c877a20
adds docs for JW Player RTD Provider
ada392c
moves auctionDelay to rtd
b757686
explains fileds required for async reqs
6380cd2
updates docs for fpd
6b5f3b9
making syntax consistent
bretg 401f465
reverts bid interface
296c876
added transition for bid adapters
bretg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
--- | ||
layout: page_v2 | ||
title: JW Player Real Time Data Provider | ||
display_name: JW Player video ad targeting | ||
description: makes JW Player's video ad targeting information accessible to Bid Adapters. | ||
page_type: module | ||
module_type: rtd | ||
module_code : jwplayer | ||
enable_download : true | ||
sidebarType : 1 | ||
--- | ||
|
||
# JW Player RTD Provider | ||
{:.no_toc} | ||
|
||
* TOC | ||
{:toc} | ||
|
||
## Overview | ||
|
||
The purpose of this Real Time Data Provider is to allow publishers to target against their JW Player media without | ||
being forced to integrate with the Player Bidding product. This prebid module makes JW Player's video ad targeting information accessible | ||
to Bid Adapters. | ||
|
||
## Implementation for Publishers: | ||
|
||
1) Compile the JW Player RTD Provider into your Prebid build: | ||
|
||
`gulp build --modules=jwplayerRtdProvider` | ||
|
||
2) Publishers must register JW Player as a Real Time Data provider by using `setConfig` to load a Prebid Config containing a `realTimeData.dataProviders` array: | ||
|
||
```javascript | ||
pbjs.setConfig({ | ||
..., | ||
realTimeData: { | ||
auctionDelay: 100, | ||
dataProviders: [{ | ||
name: "jwplayer", | ||
waitForIt: true, | ||
params: { | ||
mediaIDs: ['abc', 'def', 'ghi', 'jkl'] | ||
} | ||
}] | ||
} | ||
}); | ||
``` | ||
|
||
3) In order to prefetch targeting information for certain media, include the media IDs in the `jwplayer` var and set `waitForIt` to `true` before calling `setConfig`: | ||
|
||
**Note:** `waitForIt` is required to ensure the auction waits for the prefetching of the relvant targeting information to complete. It signals to Prebid that you allow the module to delay the auction if necessary. | ||
|
||
**Note:** setting an `auctionDelay` in the `realTimeData` object is required to ensure the auction waits for prefetching to complete. The `auctionDelay` is the max time in ms that the auction will wait for the requested targeting information. | ||
|
||
**Config Syntax details:** | ||
|
||
{: .table .table-bordered .table-striped } | ||
| Name |Type | Description | Notes | | ||
| :------------ | :------------ | :------------ |:------------ | | ||
| name | String | Real time data module name | Always 'jwplayer' | | ||
| waitForIt | Boolean | Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false | | ||
| params | Object | | | | ||
| params.mediaIDs | Array of Strings | Media Ids for prefetching | Optional | | ||
|
||
4) Include the content's media ID and/or the player's ID in the matching AdUnit's `fpd.context.data.jwTargeting` before calling `addAdUnits`: | ||
|
||
```javascript | ||
const adUnit = { | ||
code: '/19968336/prebid_native_example_1', | ||
..., | ||
fpd: { | ||
context: { | ||
data: { | ||
jwTargeting: { | ||
bretg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Note: the following Ids are placeholders and should be replaced with your Ids. | ||
playerID: 'abcd', | ||
mediaID: '1234' | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
pbjs.que.push(function() { | ||
pbjs.addAdUnits([adUnit]); | ||
pbjs.requestBids({...}); | ||
}); | ||
``` | ||
**Note**: You may also include `jwTargeting` information in the prebid config's `fpd.context.data`. Information provided in the adUnit will always supersede the information in the config; use the config to set fallback information or information that applies to all adUnits. | ||
|
||
**AdUnit Syntax details:** | ||
|
||
{: .table .table-bordered .table-striped } | ||
| Name |Type | Description | Notes | | ||
| :------------ | :------------ | :------------ |:------------ | | ||
| fpd.context.data.jwTargeting | Object | | | | ||
| fpd.context.data.jwTargeting.mediaID | String | Media Id of the content associated to the Ad Unit | Optional but highly recommended | | ||
| fpd.context.data.jwTargeting.playerID | String | Id of the JW Player instance which will render the content associated to the Ad Unit | Optional but recommended | | ||
|
||
## Implementation for Bid Adapters: | ||
|
||
Implement the `buildRequests` function. When it is called, the `bidRequests` param will be an array of bids. | ||
Each bid for which targeting information was found will conform to the following object structure: | ||
|
||
```json | ||
{ | ||
adUnitCode: 'xyz', | ||
bidId: 'abc', | ||
..., | ||
fpd: { | ||
context: { | ||
data: { | ||
jwTargeting: { | ||
segments: ['123', '456'], | ||
content: { | ||
id: 'jw_abc123' | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is wrong, we are not adding the targeting information to |
||
} | ||
} | ||
``` | ||
|
||
**Bid Syntax details:** | ||
|
||
{: .table .table-bordered .table-striped } | ||
| Name |Type | Description | Notes | | ||
| :------------ | :------------ | :------------ |:------------ | | ||
| jwTargeting | Object | | | | ||
| jwTargeting.segments | Array of Strings | jwpseg targeting segments | | | ||
| jwTargeting.content | Object | | | | ||
| jwTargeting.content.id | String | Unique identifier for the specific media asset | | | ||
|
||
## Example | ||
|
||
To view an example: | ||
|
||
- in the Prebid repo, run in your cli: | ||
|
||
`gulp serve --modules=jwplayerRtdProvider` | ||
|
||
- in your browser, navigate to: | ||
|
||
`http://localhost:9999/integrationExamples/gpt/jwplayerRtdProvider_example.html` | ||
|
||
**Note:** the mediaIds in the example are placeholder values; replace them with your existing IDs. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i disagree with this change, there is no
jwplayer
var. I think this would be confusing to the reader.var jwplayer = {...};
would be a jwplayer var. I'll address this