8000 Add adpod support to AppNexus adapter by matthewlane · Pull Request #3484 · prebid/Prebid.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add adpod support to AppNexus adapter #3484

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

Merged
merged 26 commits into from
Feb 27, 2019
Merged

Conversation

matthewlane
Copy link
Collaborator
@matthewlane matthewlane commented Jan 26, 2019

Type of change

  • Feature

Description of change

  • Adds support for 'adpod' video context to AppNexus adapter
  • Duplicates tag objects for request
  • Sets adpod-specific fields for response
  • Supports new configuration brandCategoryExclusion

Other information

This is for initial review/testing with other PRs related to #3379

Copy link
Collaborator
@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Have yet to test out these changes, but saw something I wanted to mention/suggest. See comment below.

@@ -316,6 +327,22 @@ function newBid(serverBid, rtbBid, bidderRequest) {
vastImpUrl: rtbBid.notify_url,
ttl: 3600
});

const videoContext = utils.deepAccess(
bidderRequest.bids[0],
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't always assume the first bid object will be an adpod; a publisher could be mixing the ad-types together (like banner + adpod) in the adunit.

The local bidRequest variable (here) looks to already pull the matching bid based on the id (if I'm reading that right); could you take a look at this var and see if it meets the needs here?

@matthewlane matthewlane force-pushed the adpod-adapter-support branch from 764e7c0 to dd2eacc Compare February 4, 2019 22:58
Copy link
Collaborator
@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Hi @matthewlane,

This largely looks good, but please take a look at the questions/points listed below. Thanks!

function getAdPodPlacementNumber(videoParams, requireExactDuration) {
const { adPodDurationSec, durationRangeSec } = videoParams;
const minAllowedDuration = utils.getMinValueFromArray(durationRangeSec);
const numberOfPlacements = adPodDurationSec / minAllowedDuration;
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to floor/ceil this value?

data: payloadString,
bidderRequest
};
const adPodBid = find(bidRequests, hasAdPod);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't this find function only grab the first bid it matches? What if there are multiple bids in the bidRequests object as a result from multiple adpod adUnits?


bid.video = {
context: 'adpod',
durationSeconds: rtbBid.rtb.video.duration_ms / 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to floor/ceil here - in case the numbers aren't clean?

let request = utils.fill(...tagToDuplicate, numberOfPlacements);

if (requireExactDuration) {
const divider = numberOfPlacements / durationRangeSec.length;
Copy link
Collaborator

Choose a reason for hiding this comment

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

need a floor/ceil here?

return (
bid.mediaTypes &&
bid.mediaTypes.video &&
bid.mediaTypes.video.context === 'adpod'
Copy link
Collaborator

Choose a reason for hiding this comment

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

< 10000 button type="submit" data-view-component="true" class="Button--secondary Button--medium Button d-inline-block"> Hide comment

We added adpod context to mediaTypes.js file here.
#3523
You can update to use this const.

@matthewlane matthewlane force-pushed the adpod-adapter-support branch from dd2eacc to 71071c0 Compare February 6, 2019 22:25
Copy link
Collaborator
@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

LGTM

@mkendall07 mkendall07 self-requested a review February 25, 2019 16:46
@mkendall07
Copy link
Member

This pull request introduces 1 alert when merging 0635c0f into b6c5644 - view on LGTM.com

new alerts:

  • 1 for Invocation of non-function

Comment posted by LGTM.com

…er-support

# Conflicts:
#	modules/appnexusBidAdapter.js
@jaiminpanchal27 jaiminpanchal27 merged commit 621a057 into master Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0