Skip to content

Commit

Permalink
Use native targeting keys in enableSendAllBids
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlane committed May 5, 2017
1 parent 35369e8 commit 2d6da07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bidmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function getKeyValueTargetingPairs(bidderCode, custBidObj) {
Object.keys(custBidObj.native).forEach(asset => {
const key = NATIVE_KEYS[asset];
const value = custBidObj.native[asset];
keyValues[key] = value;
if (key) {keyValues[key] = value;}
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const NATIVE_KEYS = {
click_url: 'hb_native_linkurl',
};

export const NATIVE_TARGETING_KEYS = Object.keys(NATIVE_KEYS).map(
key => NATIVE_KEYS[key]
);

const IMAGE = {
image: {required: true},
title: {required: true},
Expand Down
3 changes: 2 additions & 1 deletion src/targeting.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { uniques, isGptPubadsDefined, getHighestCpm, adUnitsFilter } from './utils';
import { NATIVE_TARGETING_KEYS } from './native';
const bidmanager = require('./bidmanager.js');
const utils = require('./utils.js');
var CONSTANTS = require('./constants.json');
Expand Down Expand Up @@ -150,7 +151,7 @@ function getAlwaysUseBidTargeting(adUnitCodes) {
}

function getBidLandscapeTargeting(adUnitCodes) {
const standardKeys = CONSTANTS.TARGETING_KEYS;
const standardKeys = CONSTANTS.TARGETING_KEYS.concat(NATIVE_TARGETING_KEYS);

return $$PREBID_GLOBAL$$._bidsReceived
.filter(adUnitsFilter.bind(this, adUnitCodes))
Expand Down

0 comments on commit 2d6da07

Please sign in to comment.