-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Consistent targeting set #2592
Consistent targeting set #2592
Conversation
src/targeting.js
Outdated
targeting.push(emptyTargeting); | ||
} | ||
}); | ||
|
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 think this could be greatly simplified by replacing it with the following code after the flattenTargeting
is called below
adUnitCodes.forEach(code => {
if (!targeting[code]) {
targeting[code] = {};
}
});
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.
Good point! Will give it a try
Updated, all tests run as expect @snapwich |
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.
LGTM
Type of change
Description of change
The idea is that users of SET_TARGETING who receives the argument targeting set, should be able to get the ad unit codes always involved even though a bid not might be available when rendering the ad
Other information
Previously I tried to introduce the adUnits into the arguments #1875
and since then the targetingSet has been starting to get passed. In order to make this without breaking any contracts my suggestion is that we always return a entry even though there is no bid available to the receiver of SET_TARGETING can iterate which ad unit codes are getting invoked.