Skip to content

Commit 09cc765

Browse files
committed
analytics report remove bid req config
1 parent 7d8cf9e commit 09cc765

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/main/java/org/prebid/server/analytics/reporter/greenbids/GreenbidsAnalyticsReporter.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676

7777
public class GreenbidsAnalyticsReporter implements AnalyticsReporter {
7878

79-
private static final String BID_REQUEST_ANALYTICS_EXTENSION_NAME = "greenbids";
8079
private static final int RANGE_16_BIT_INTEGER_DIVISION_BASIS = 0x10000;
8180
private static final String ANALYTICS_REQUEST_ORIGIN_HEADER = "X-Request-Origin";
8281
private static final String PREBID_SERVER_HEADER_VALUE = "Prebid Server";
@@ -120,9 +119,7 @@ public <T> Future<Void> processEvent(T event) {
120119
return Future.failedFuture(new PreBidException("Bid response or auction context cannot be null"));
121120
}
122121

123-
final GreenbidsPrebidExt greenbidsBidRequestExt = Optional.ofNullable(
124-
parseBidRequestExt(auctionContext.getBidRequest()))
125-
.orElse(parseAccountConfig(auctionContext));
122+
final GreenbidsPrebidExt greenbidsBidRequestExt = parseAccountConfig(auctionContext);
126123

127124
if (greenbidsBidRequestExt == null) {
128125
return Future.succeededFuture();
@@ -165,6 +162,12 @@ public <T> Future<Void> processEvent(T event) {
165162
.map(Device::getUa)
166163
.ifPresent(userAgent -> headers.add(HttpUtil.USER_AGENT_HEADER, userAgent));
167164

165+
System.out.println(
166+
"GreenbidsAnalyticsReporter/ processEvent \n" +
167+
" commonMessageJson: " + commonMessageJson + "\n" +
168+
" headers: " + headers
169+
);
170+
168171
final Future<HttpClientResponse> responseFuture = httpClient.post(
169172
greenbidsAnalyticsProperties.getAnalyticsServerUrl(),
170173
headers,
@@ -174,17 +177,6 @@ public <T> Future<Void> processEvent(T event) {
174177
return responseFuture.compose(this::processAnalyticServerResponse);
175178
}
176179

177-
private GreenbidsPrebidExt parseBidRequestExt(BidRequest bidRequest) {
178-
return Optional.ofNullable(bidRequest)
179-
.map(BidRequest::getExt)
180-
.map(ExtRequest::getPrebid)
181-
.map(ExtRequestPrebid::getAnalytics)
182-
.filter(this::isNotEmptyObjectNode)
183-
.map(analytics -> (ObjectNode) analytics.get(BID_REQUEST_ANALYTICS_EXTENSION_NAME))
184-
.map(this::toGreenbidsPrebidExt)
185-
.orElse(null);
186-
}
187-
188180
private GreenbidsPrebidExt parseAccountConfig(AuctionContext auctionContext) {
189181
final Map<String, ObjectNode> modules = Optional.ofNullable(auctionContext)
190182
.map(AuctionContext::getAccount)
@@ -196,6 +188,12 @@ private GreenbidsPrebidExt parseAccountConfig(AuctionContext auctionContext) {
196188
if (modules != null && modules.containsKey("greenbids")) {
197189
final ObjectNode moduleConfig = modules.get("greenbids");
198190
greenbidsPrebidExt = toGreenbidsPrebidExt(moduleConfig);
191+
192+
System.out.println(
193+
"GreenbidsAnalyticsReporter/ parseAccountConfig \n" +
194+
" moduleConfig: " + moduleConfig + "\n" +
195+
" greenbidsPrebidExt: " + greenbidsPrebidExt
196+
);
199197
}
200198

201199
return greenbidsPrebidExt;

src/main/java/org/prebid/server/analytics/reporter/greenbids/model/GreenbidsPrebidExt.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
@Value(staticConstructor = "of")
77
public class GreenbidsPrebidExt {
88

9+
Boolean enabled;
10+
911
String pbuid;
1012

1113
@JsonProperty("greenbidsSampling")

0 commit comments

Comments
 (0)