a route /units-for-slot/${slotId} , which returns all ad units which match this slot; it will apply publisher earning limits and optionally apply targeting
Steps:
[x] PR #26 Applying publisher limits. We should check the publisher ID (owner property of the slot) whether he exceeds the publisher limits. This is done by comparing the earnings of the publisher with the limit (defined by the market). If it exceeds it, return an empty array for the slots and the earning limit.
[x] #11 (PR #13) The limit is defined in the market cfg.js with the property limitedIdentityEarningsLimit. It is not exposed by the market. We can copy-paste both limitedIdentityEarningsLimit and limitedIdentityEnabled from the market's cfg.js
impled in with use of an Option
[x] (PR #14) To get the publisher earnings we can use the cached data. (All campaigns including finalized)
Cache::get_earnings_for
[x] PR #14 First we will need to get the information about the Slot, other than the id. Luckily the market has a route for retrieving slot information. We need to call ${market_url}/slots/${slot_id}. This will return the slot object.
[x] PR #14 Next we need to find ad units which match that slot. First we need to get all units by calling ${market_url}/units/ and then filtering them to have the same type as our slot.
[x] #15 (PR #22) NOTE: To optimise we can modify the market route to accept type as a query parameter which would be added to the mongo query.
[x] PR #26 Applying targeting. ~Optional but should always be applied unless there is a ?noTargeting query parameter provided.~ It should find matches between the unit targeting and the slot tags. More details on how to implement after the targeting overhaul
NOTE: the supermarket no longer needs a special mode in which it doesn't apply targeting, since it will always apply targeting, but the rules which depend on sensitive (AdEx profile) data will simply be ignored, and they will be applied on the client side (AdView).
Apply maximum N of campaigns you can earn from as a Publisher
[x] PR #26 Add configuration for the maximum N(umber) of campaigns
[x] PR #26 Limit the returned Campaigns to N
[x] Return the filtered ad units.
~issues and/or stats: a list of possible reasons why there are no returned units: NO_ACTIVE_CAMPAIGNS, CAMPAIGNS_NOT_SOUND, NO_DEPOSITASSET_CAMPAIGNS, NO_UNITS_FOR_SIZE, NO_UNITS_FOR_TARGETING, NO_UNITS_FOR_ADSLOTRULES, SLOT_NOT_VERIFIED (if acceptedReferrers.length == 0)~ Moved to own issue for enhancement #32
Related to https://github.com/AdExNetwork/adex-market/issues/101
What needs to be done:
Steps:
[x] PR #26 Applying publisher limits. We should check the publisher ID (
owner
property of the slot) whether he exceeds the publisher limits. This is done by comparing the earnings of the publisher with the limit (defined by the market). If it exceeds it, return an empty array for the slots and the earning limit.[x] #11 (PR #13) The limit is defined in the market
cfg.js
with the propertylimitedIdentityEarningsLimit
. It is not exposed by the market. We can copy-paste bothlimitedIdentityEarningsLimit
andlimitedIdentityEnabled
from the market'scfg.js
Option
[x] (PR #14) To get the publisher earnings we can use the cached data. (All campaigns including finalized)
Cache::get_earnings_for
[x] PR #14 First we will need to get the information about the Slot, other than the id. Luckily the market has a route for retrieving slot information. We need to call
${market_url}/slots/${slot_id}
. This will return the slot object.[x] PR #14 Next we need to find ad units which match that slot. First we need to get all units by calling
${market_url}/units/
and then filtering them to have the sametype
as our slot.type
as a query parameter which would be added to the mongo query.[x] PR #26 Applying targeting. ~Optional but should always be applied unless there is a
?noTargeting
query parameter provided.~ It should find matches between the unittargeting
and the slottags
. More details on how to implement after the targeting overhaul[x] Return the filtered ad units.
issues
and/orstats
: a list of possible reasons why there are no returned units: NO_ACTIVE_CAMPAIGNS, CAMPAIGNS_NOT_SOUND, NO_DEPOSITASSET_CAMPAIGNS, NO_UNITS_FOR_SIZE, NO_UNITS_FOR_TARGETING, NO_UNITS_FOR_ADSLOTRULES, SLOT_NOT_VERIFIED (ifacceptedReferrers.length == 0
)~ Moved to own issue for enhancement #32TODOs:
depositAsset
) the same way as JS in order to have consistency. See https://github.com/AdExNetwork/adex-adview-manager/pull/67#discussion_r437173362 for more details