Skip to content
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

Document pbjs.adServers.dfp.buildVideoUrl update to accept ad server URL #422

Merged
merged 5 commits into from
Nov 15, 2017

Conversation

rmloveland
Copy link
Contributor

Relates to prebid/Prebid.js#1663

@matthewlane Would you mind taking a look at these docs? They still need some refinement and shortening. I'm trying to figure out how to make them shorter given the interaction of options.params vs. options.url vs. Prebid Cache being enabled or not.

In the meantime, I'd appreciate if you could take a look! Specifically:

  • Are there any technical errors in what I've written?
  • Are you able to answer my questions marked with 'FIXME' in this PR?
  • I'm a little confused about the interaction of cache with URL usage - sounds like the big thing is that the bidder must return a vastUrl if cache is disabled, right? Any thoughts on how to make that explanation simpler, or just a comment on how you tend to think about how it works, would be really appreciated :-)
  • Any other feedback / thoughts that come to mind

Thanks!

Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Rich, left a few comments.

I'm a little confused about the interaction of cache with URL usage - sounds like the big thing is that the bidder must return a vastUrl if cache is disabled, right? Any thoughts on how to make that explanation simpler, or just a comment on how you tend to think about how it works

That's correct, if cache is disabled the bid must contain a vastUrl to work properly. Going to think about the second part of the question and will get back to you on it, wanted to post the first set of comments for now

Update: right -- with prebid-cache enabled, and when a url is passed to pbjs.adServers.dfp.buildVideoUrl, Prebid does not set the description_url to the bid.vastUrl, it only attaches the bid's adserver targeting, rebuilds the url based on the input, and returns that. For url inputs, Prebid sets description_url to the bid.vastUrl when prebid-cache is disabled.


The `options.params` object contains the parameters needed to form a URL which hits the [DFP API](https://support.google.com/dfp_premium/answer/1068325?hl=en). It has the following fields:

<span style="color: rgb(255,0,0);">FIXME</span>: is "arbitraryKey" still supported? not seeing anything explicitly mentioning it in the code at a glance, but may have missed it. It's also not mentioned in the JSDoc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, no. I hadn't seen usage of this before, and it seems like sending custom key-value pairs is covered by the cust_params field, so possibly cust_params is a replacement for that


The table below lists the expected behavior of this method when called with various configurations.

<span class="FIXME" style="color: rgb(255,0,0);">FIXME</span>: In the PR comment (https://github.com/prebid/Prebid.js/pull/1663) options.params with cache DISABLED is not mentioned. Does it work?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if the correct adserver adunit id is used. In our example case, /19968336/prebid_cache_video_adunit is the adunit id used when prebid-cache is enabled, which is correct. If prebid-cache is disabled, that same adunit id will no longer work, but /19968336/prebid_video_adunit will because it is expecting a vast url rather than a prebid-cache key


<span class="FIXME" style="color: rgb(255,0,0);">FIXME</span>: In the PR comment (https://github.com/prebid/Prebid.js/pull/1663) options.params with cache DISABLED is not mentioned. Does it work?

<span style="color: rgb(255,0,0);">FIXME</span>: are updates to video bidder adapter docs required? e.g., to note that they must always supply a <code>vastUrl</code> as described at https://corpwiki.appnexus.com/x/8jWcBw
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Video bidders must supply either vastUrl or vastXml. They may supply both. If the video bidder supplies only vastXml and prebid-cache is disabled, this will not work and the bid will be dropped from the auction (if prebid-cache is enabled, this same scenario is fine). If a video bidder supplies neither vastUrl or vastXml, the bid is dropped.

|---------------------------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options.params` only | Yes | If you set `description_url`, we use that; otherwise this method will automagically build it for you. |
| `options.params` only | No | Bidder must respond with **only** `bid.vastUrl` - `bid.vastXml` won't work. |
| `options.params` and `options.url` together | Yes | DOES NOT WORK (?) according to https://corpwiki.appnexus.com/x/8jWcBw - or is it simply the case that the bidder must provide `bid.vastUrl` (as below)? |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, Prebid doesn't set a description_url in this case

| Argument | Prebid Cache Enabled? | Notes |
|---------------------------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options.params` only | Yes | If you set `description_url`, we use that; otherwise this method will automagically build it for you. |
| `options.params` only | No | Bidder must respond with **only** `bid.vastUrl` - `bid.vastXml` won't work. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bidder must contain bid.vastUrl, correct, but if there is also a bid.vastXml it will still work, the xml just wouldn't be used.

Rich Loveland added 2 commits November 8, 2017 15:47
The table below lists the expected behavior of this method when called with various combinations of arguments and cache usage.

{: .table .table-bordered .table-striped }
| Argument | Prebid Cache Enabled? | Notes |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewlane based on your comment update re: how/when description_url gets built, I added some more info to this table. I also added two more lines for the "only using options.url cases with cache on/off.

Are the descriptions of what happens in each of these cases correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmloveland One update for the notes in options.url only, cache enabled

Prebid attaches the bid’s adserver targeting and rebuilds the URL based on the input by merging publisher input with default values. It does not set description_url to bid.vastUrl.

default values aren't merged in this case, the resulting url is just based off the input url with adserver targeting attached.

All other descriptions look good to me

|--------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| adUnit | object | (Required) The Prebid adUnit to which the returned URL will map. |
| bid | object | (Optional) The Prebid bid for which targeting will be set. If this is not defined, Prebid will use the bid with the highest CPM for the adUnit. |
| params | object | (Required) Querystring parameters that will be used to construct the DFP video ad tag URL. Publisher-supplied values will override values set by Prebid.js. See below for fields. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that Options.params is required. It should be acceptable to invoke buildVideoUrl with an Options object that contains either the "url" or "params" field.

@matthewlane can we confirm the expected behavior if both Options.params and Options.url are passed to buildVideoUrl?

Copy link
Collaborator

@matthewlane matthewlane Nov 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, options.params isn't required, the pub can pass either options.params, options.url, or both, but not neither.

If both params and url are passed in, the url is parsed, and any equivalent params that are present will overwrite those that were present in the url (in other words, in the event of collisions, params takes precedence). Then everything else that happens when just params were passed in still happens (adding defaults, adserver targeting, etc.), everything is stringified back to a url, and this is returned


#### Usage scenarios and expected behavior

How you call `dfp.buildVideoUrl` may change depending on:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to rework or possibly eliminate this section. Options.params and Options.url are not really intended for distinct sets of use-cases. We allow users to either pass an existing adserver URL or an object containing adserver URL querystring parameters for convenience.


{: .alert.alert-info :}
**Bid Responses and Prebid Cache**
Video bidders must supply either `bid.vastUrl` or `bid.vastXml`. They may supply both. If the video bidder supplies *only* `bid.vastXml` and Prebid Cache is disabled, this will not work and the bid will be dropped from the auction (if Prebid Cache is enabled, this same scenario is fine). If a video bidder supplies neither `bid.vastUrl` or `bid.vastXml`, the bid is dropped.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get rid of the last sentence: "If a video bidder supplies neither bid.vastUrl or bid.vastXml, the bid is dropped.", as it seems repetitive.


The table below lists the expected behavior of this method when called with various combinations of arguments and cache usage.

{: .table .table-bordered .table-striped }
Copy link
Contributor

@mjacobsonny mjacobsonny Nov 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to figure out how to represent more clearly the information in the table below, as it seems a bit confusing to me at the moment.

@rmloveland rmloveland merged commit 8056d67 into master Nov 15, 2017
@rmloveland rmloveland deleted the RAD-1860 branch November 15, 2017 21:08
rmloveland pushed a commit that referenced this pull request Nov 27, 2017
Was originally going to add this info in

#422

but it fits better here.
rmloveland added a commit that referenced this pull request Dec 18, 2017
Was originally going to add this info in

#422

but it fits better here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants