Skip to content
Open
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
395 changes: 395 additions & 0 deletions src/main/java/org/prebid/server/bidder/msft/MsftBidder.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.prebid.server.bidder.msft.proto;

import lombok.Builder;
import lombok.Value;

@Value
@Builder(toBuilder = true)
public class ExtRequestMsft {

Boolean includeBrandCategory;

Boolean brandCategoryUniqueness;

Integer isAmp;

Integer hbSource;
}
19 changes: 19 additions & 0 deletions src/main/java/org/prebid/server/bidder/msft/proto/MsftBidExt.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.prebid.server.bidder.msft.proto;

import lombok.Builder;
import lombok.Value;

@Value
@Builder
public class MsftBidExt {

int bidAdType;

Integer brandId;

Integer brandCategoryId;

MsftBidExtCreative creativeInfo;

int dealPriority;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.prebid.server.bidder.msft.proto;

import lombok.Value;

@Value(staticConstructor = "of")
public class MsftBidExtCreative {

MsftBidExtVideo video;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.prebid.server.bidder.msft.proto;

import lombok.Value;

@Value(staticConstructor = "of")
public class MsftBidExtVideo {

Integer duration;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.prebid.server.bidder.msft.proto;

import lombok.Builder;
import lombok.Value;

@Value
@Builder
public class MsftExtImpOutgoing {

Integer placementId;

Boolean allowSmallerSizes;

Boolean usePmtRule;

String keywords;

String trafficSourceCode;

String pubClick;

String extInvCode;

String extImpId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.prebid.server.proto.openrtb.ext.request.msft;

import lombok.Builder;
import lombok.Value;

import java.util.List;

@Value
@Builder
public class ExtImpMsft {

Integer placementId;

Integer member;

String invCode;

Boolean allowSmallerSizes;

Boolean usePmtRule;

String keywords;

String trafficSourceCode;

String pubclick;

String extInvCode;

String extImpId;

List<Integer> bannerFrameworks;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.prebid.server.spring.config.bidder;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.prebid.server.bidder.BidderDeps;
import org.prebid.server.bidder.msft.MsftBidder;
import org.prebid.server.json.JacksonMapper;
import org.prebid.server.spring.config.bidder.model.BidderConfigurationProperties;
import org.prebid.server.spring.config.bidder.util.BidderDepsAssembler;
import org.prebid.server.spring.config.bidder.util.UsersyncerCreator;
import org.prebid.server.spring.env.YamlPropertySourceFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.validation.annotation.Validated;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.Map;

@Configuration
@PropertySource(value = "classpath:/bidder-config/msft.yaml", factory = YamlPropertySourceFactory.class)
public class MsftConfiguration {

private static final String BIDDER_NAME = "msft";

@Bean("msftConfigurationProperties")
@ConfigurationProperties("adapters.msft")
MsftConfigurationProperties configurationProperties() {
return new MsftConfigurationProperties();
}

@Bean
BidderDeps msftBidderDeps(MsftConfigurationProperties msftConfigurationProperties,
@NotBlank @Value("${external-url}") String externalUrl,
JacksonMapper mapper) {

return BidderDepsAssembler.forBidder(BIDDER_NAME)
.withConfig(msftConfigurationProperties)
.usersyncerCreator(UsersyncerCreator.create(externalUrl))
.bidderCreator(config -> new MsftBidder(
config.getEndpoint(),
msftConfigurationProperties.getHbSource(),
msftConfigurationProperties.getHbSourceVideo(),
msftConfigurationProperties.getIabCategories(),
mapper))
.assemble();
}

@Validated
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
private static class MsftConfigurationProperties extends BidderConfigurationProperties {

@NotNull
Integer hbSource = 5;

@NotNull
Integer hbSourceVideo = 6;

Map<Integer, String> iabCategories;
}
}
118 changes: 118 additions & 0 deletions src/main/resources/bidder-config/msft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
adapters:
msft:
endpoint: http://ib.adnxs.com/openrtb2
meta-info:
maintainer-email: prebid@microsoft.com
app-media-types:
- banner
- video
- native
site-media-types:
- banner
- video
- native
supported-vendors:
vendor-id: 32
usersync:
cookie-family-name: adnxs
redirect:
url: https://ib.adnxs.com/getuid?{{redirect_url}}
support-cors: false
uid-macro: '$UID'
platform-id: 5
iab-categories:
1: IAB20-3
2: IAB18-5
3: IAB10-1
4: IAB2-3
5: IAB19-8
6: IAB22-1
7: IAB18-1
8: IAB12-3
9: IAB5-1
10: IAB4-5
11: IAB13-4
12: IAB8-7
13: IAB9-7
14: IAB7-1
15: IAB20-18
16: IAB10-7
17: IAB19-18
18: IAB13-6
19: IAB18-4
20: IAB1-5
21: IAB1-6
22: IAB3-4
23: IAB19-13
24: IAB22-2
25: IAB3-9
26: IAB17-18
27: IAB19-6
28: IAB1-7
29: IAB9-30
30: IAB20-7
31: IAB20-17
32: IAB7-32
33: IAB16-5
34: IAB19-34
35: IAB11-5
36: IAB12-3
37: IAB11-4
38: IAB12-3
39: IAB9-30
41: IAB7-44
42: IAB7-1
43: IAB7-30
50: IAB19-30
51: IAB17-12
52: IAB19-30
53: IAB3-1
55: IAB13-2
56: IAB19-30
57: IAB19-30
58: IAB7-39
59: IAB22-1
60: IAB7-39
61: IAB21-3
62: IAB5-1
63: IAB12-3
64: IAB20-18
65: IAB11-2
66: IAB17-18
67: IAB9-9
68: IAB9-5
69: IAB7-44
71: IAB22-3
73: IAB19-30
74: IAB8-5
78: IAB22-1
85: IAB12-2
86: IAB22-3
87: IAB11-3
112: IAB7-32
113: IAB7-32
114: IAB7-32
115: IAB7-32
118: IAB9-5
119: IAB9-5
120: IAB9-5
121: IAB9-5
122: IAB9-5
123: IAB9-5
124: IAB9-5
125: IAB9-5
126: IAB9-5
127: IAB22-1
132: IAB1-2
133: IAB19-30
137: IAB3-9
138: IAB19-3
140: IAB2-3
141: IAB2-1
142: IAB2-3
143: IAB17-13
166: IAB11-4
175: IAB3-1
176: IAB13-4
182: IAB8-9
183: IAB3-5
68 changes: 68 additions & 0 deletions src/main/resources/static/bidder-params/msft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Microsoft Adapter Params",
"description": "A schema which validates params accepted by the Microsoft adapter",
"type": "object",
"properties": {
"placement_id": {
"type": "integer",
"description": "Placement ID from Microsoft Monetize. You may use inv_code with member instead of a placement_id."
},
"member": {
"type": "integer",
"description": "Member ID from Microsoft Monetize. Must be used with inv_code."
},
"inv_code": {
"type": "string",
"description": "Inventory code from Microsoft Monetize. Must be used with member."
},
"allow_smaller_sizes": {
"type": "boolean",
"description": "If true, ads smaller than your ad unit's size array will be allowed to serve."
},
"use_pmt_rule": {
"type": "boolean",
"description": "If true, Microsoft Monetize will return net price after publisher payment rules are applied."
},
"keywords": {
"type": "string",
"description": "Comma-delimited key-value pairs (max 100). Must be enabled by a Microsoft Monetize account manager."
},
"traffic_source_code": {
"type": "string",
"description": "Specifies the third-party source of this impression."
},
"pubclick": {
"type": "string",
"description": "Specifies a publisher supplied url for third-party click tracking."
},
"ext_inv_code": {
"type": "string",
"description": "Specifies predefined value passed on the query string that can be used in reporting. The value must be entered into Microsoft Monetize before it is logged.."
},
"ext_imp_id": {
"type": "string",
"description": "Specifies the unique identifier of an externally generated auction."
},
"banner_frameworks": {
"type": "array",
"items": {
"type": "integer"
},
"description": "List of supported API frameworks for banner ads supported by the publisher."
}
},
"oneOf": [
{
"required": [
"placement_id"
]
},
{
"required": [
"inv_code",
"member"
]
}
]
}
Loading
Loading