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

Remove hb_winurl, hb_bidid targeting values #895

Merged
merged 6 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/differenceBetweenPBSGo-and-Java.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and not the other for an interim period. This page tracks known differences that
1) PBS-Java support caching winning bids only through `auction.cache.only-winning-bids` configuration property or request field `request.ext.prebid.cache.winningonly`. PBS-Java [issue 279](https://github.com/rubicon-project/prebid-server-java/issues/279), [PR 484](https://github.com/rubicon-project/prebid-server-java/pull/484).
1) PBS-Java has a specific `host-cookie` and `uids` cookie processing for all endpoints, that sets `uids.HOST-BIDDER` from `host-cookie` if first is absent or not equal to second.
1) PBS-Java has a specific `/cookie-sync` behaviour, that sets `/setuid` as usersync-url for host-bidder if `host-cookie` specified but `uids.HOST-BIDDER` undefined or differs.
1) PBS-Java has `/event` endpoint to allow Web browsers and mobile applications to notify about different ad events (win, view etc). Filling new bid extensions `response.seatbid.bid.ext.prebid.events.{win,view}` with events url after successful auction completing makes it possible. Also new targeting parameter `hb_winurl` with win event url is supported.
1) PBS-Java has `/event` endpoint to allow Web browsers and mobile applications to notify about different ad events (win, view etc). Filling new bid extensions `response.seatbid.bid.ext.prebid.events.{win,view}` with events url after successful auction completing makes it possible.
1) PBS-Java supports per-account cache TTL and event URLs configuration in the database in columns `banner_cache_ttl`, `video_cache_ttl` and `events_enabled`.
1) PBS-Java does not support passing bidder extensions in `imp[...].ext.prebid.bidder`. PBS-Go [PR 846](https://github.com/prebid/prebid-server/pull/846)
1) PBS-Java responds with active bidders only in `/info/bidders` and `/info/bidders/all` endpoints, although PBS-Go returns all implemented ones. Calling `/info/bidders/{bidderName}` with a disabled bidder name will result in 404 Not Found, which is a desired behaviour, unlike in PBS-Go [issue 988](https://github.com/prebid/prebid-server/issues/988), [PR](https://github.com/prebid/prebid-server/pull/989).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ private Map<BidType, TargetingKeywordsCreator> keywordsCreatorByBidType(ExtReque
}

final Map<BidType, TargetingKeywordsCreator> result = new EnumMap<>(BidType.class);
final int resolvedTruncateAttrChars = resolveTruncateAttrChars(targeting, account);

final ObjectNode banner = mediaTypePriceGranularity.getBanner();
final boolean isBannerNull = banner == null || banner.isNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ public class TargetingKeywordsCreator {
* Stores http path for cache service endpoint.
*/
private static final String HB_CACHE_PATH_KEY = "hb_cache_path";
/**
* Stores win type url to support event notification.
*/
private static final String HB_WINURL_KEY = "hb_winurl";

/**
* Collection of keys to be excluded from creating key with "_BIDDER" suffix
*/
private static final Set<String> EXCLUDED_BIDDER_KEYS = Collections.singleton(HB_WINURL_KEY);

private final PriceGranularity priceGranularity;
private final boolean includeWinners;
Expand Down Expand Up @@ -223,19 +214,18 @@ Map<String, String> makeFor(com.iab.openrtb.response.Bid bid,
/**
* Common method for creating targeting keywords.
*/
private Map<String, String> makeFor(
String bidder,
boolean winningBid,
BigDecimal price,
String defaultCpm,
Integer width,
Integer height,
String cacheId,
String vastCacheId,
String dealId) {
private Map<String, String> makeFor(String bidder,
boolean winningBid,
BigDecimal price,
String defaultCpm,
Integer width,
Integer height,
String cacheId,
String vastCacheId,
String dealId) {

final KeywordMap keywordMap = new KeywordMap(bidder, winningBid, includeWinners, includeBidderKeys,
EXCLUDED_BIDDER_KEYS);
Collections.emptySet());

final String roundedCpm = isPriceGranularityValid() ? CpmRange.fromCpm(price, priceGranularity) : defaultCpm;
keywordMap.put(HB_PB_KEY, roundedCpm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ public void shouldTruncateTargetingKeywordsByGlobalConfig() {
tuple("hb_pb", "5.00"),
tuple("hb_pb_someVeryLongBi", "5.00"),
tuple("hb_bidder", "someVeryLongBidderName"),
tuple("hb_bidder_someVeryLo", "someVeryLongBidderName"),
tuple("hb_bidder_someVeryLo", "someVeryLongBidderName"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,14 @@ public void shouldReturnTargetingKeywordsWithEntireKeysOpenrtb() {
@Test
public void shouldReturnTargetingKeywordsForWinningBid() {
// given
final Bid bid = Bid.builder().bidder("bidder1").price(BigDecimal.ONE).dealId("dealId1").cacheId("cacheId1")
.width(50).height(100).build();
final Bid bid = Bid.builder()
.bidder("bidder1")
.price(BigDecimal.ONE)
.dealId("dealId1")
.cacheId("cacheId1")
.width(50)
.height(100)
.build();

// when
final Map<String, String> keywords = TargetingKeywordsCreator.create(
Expand Down Expand Up @@ -177,8 +183,12 @@ public void shouldReturnTargetingKeywordsForWinningBid() {
@Test
public void shouldReturnTargetingKeywordsForWinningBidOpenrtb() {
// given
final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE)
.dealid("dealId1").w(50).h(100).build();
final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder()
.price(BigDecimal.ONE)
.dealid("dealId1")
.w(50)
.h(100)
.build();

// when
final Map<String, String> keywords = TargetingKeywordsCreator.create(
Expand Down Expand Up @@ -381,12 +391,12 @@ public void shouldTruncateTargetingWithoutBidderSuffixKeywordsIfTruncateAttrChar
final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build();

// when
final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, false, false, 5)
final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, false, false, 7)
.makeFor(bid, "bidder", true, null, null);

// then
assertThat(keywords).hasSize(2)
.containsKeys("hb_bi", "hb_pb");
.containsKeys("hb_bidd", "hb_pb");
}

@Test
Expand Down