Skip to content

Update cookie sync to use bidder name instead of cookie family#4464

Open
Lightwood13 wants to merge 7 commits into
masterfrom
update-cookie-sync-to-use-bidder-name-instead-of-cookie-family
Open

Update cookie sync to use bidder name instead of cookie family#4464
Lightwood13 wants to merge 7 commits into
masterfrom
update-cookie-sync-to-use-bidder-name-instead-of-cookie-family

Conversation

@Lightwood13

Copy link
Copy Markdown
Collaborator

Port of https://github.com/prebid/prebid-server/pull/2948/changes

  1. Updated /cookie_sync endpoint to return bidder name instead of cookie family name in the redirect url.
  2. Updated /setuid endpoint to accept bidder name instead of cookie family name.

@Lightwood13 Lightwood13 requested review from And1sS and CTMBNara April 16, 2026 12:37
@Lightwood13 Lightwood13 force-pushed the update-cookie-sync-to-use-bidder-name-instead-of-cookie-family branch from ab59133 to 522d1c8 Compare April 20, 2026 12:57
…ead-of-cookie-family

# Conflicts:
#	src/main/java/org/prebid/server/spring/config/bidder/TaboolaConfiguration.java
final String body;
switch (error) {
case InvalidRequestException invalidRequestException -> {
case InvalidRequestException ignored -> {
body = "Invalid request format: " + message;
}
case UnauthorizedUidsException unauthorizedUidsException -> {
case UnauthorizedUidsException ignored -> {
body = "Unauthorized: " + message;
}
case UnavailableForLegalReasonsException unavailableForLegalReasonsException -> {
case UnavailableForLegalReasonsException ignored -> {
body = "Unavailable For Legal Reasons.";
}
case InvalidAccountConfigException invalidAccountConfigException -> {
case InvalidAccountConfigException ignored -> {
@Lightwood13 Lightwood13 force-pushed the update-cookie-sync-to-use-bidder-name-instead-of-cookie-family branch from df57b22 to 75acdfd Compare June 11, 2026 13:12
Comment on lines +17 to +34
private static final String CALLBACK_URL_TEMPLATE = """
%s/setuid?\
bidder=%s\
&gdpr={{gdpr}}\
&gdpr_consent={{gdpr_consent}}\
&us_privacy={{us_privacy}}\
&gpp={{gpp}}\
&gpp_sid={{gpp_sid}}\
&f={{format}}\
&uid=%s""";

private static final String GDPR_PLACEHOLDER = "{{gdpr}}";
private static final String GDPR_CONSENT_PLACEHOLDER = "{{gdpr_consent}}";
private static final String US_PRIVACY_PLACEHOLDER = "{{us_privacy}}";
private static final String GPP_PLACEHOLDER = "{{gpp}}";
private static final String GPP_SID_PLACEHOLDER = "{{gpp_sid}}";
private static final String REDIRECT_URL_PLACEHOLDER = "{{redirect_url}}";
private static final String FORMAT_PLACEHOLDER = "{{format}}";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%s -> {{MACRO}}

Comment on lines +119 to +123
@Value(staticConstructor = "of")
private static class UsersyncUrls {
String usersyncUrl;
String redirectUrl;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

biddersWithDuplicateCookieFamilyName.add(bidder);
}
}
final Set<String> biddersOverLimit = new HashSet<>(IteratorUtils.toList(biddersIterator));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StreamUtil.asStream(biddersIterator).toSet()

Comment on lines +120 to +121
.collect(Collectors.toMap(Function.identity(),
bidder -> bidderCatalog.usersyncerByName(bidder).orElseThrow()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix styling

}

@Bean
UsersyncInfoFactory usersyncInfoBuilder(@Value("${external-url}") String externalUrl) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename bean

.extracting(CookieSyncContext::getBiddersContext)
.extracting(BiddersContext::allowedBidders)
.asInstanceOf(InstanceOfAssertFactories.COLLECTION)
.hasSize(1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containsExactly
Also, check for rejected entries

.extracting(CookieSyncContext::getBiddersContext)
.extracting(BiddersContext::rejectedBidders)
.isEqualTo(Map.of("requested-bidder", RejectionReason.DISALLOWED_ACTIVITY));
.isEqualTo(Map.of("coop-sync-bidder", RejectionReason.OVER_LIMIT));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, check for requested-bidder

.extracting(CookieSyncContext::getBiddersContext)
.extracting(BiddersContext::allowedBidders)
.asInstanceOf(InstanceOfAssertFactories.set(String.class))
.containsExactly("coop-sync-bidder");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

.unwrap()
.extracting(CookieSyncContext::getBiddersContext)
.extracting(BiddersContext::rejectedBidders)
.isEqualTo(Map.of("coop-sync-bidder", RejectionReason.DUPLICATE_COOKIE_FAMILY_NAME));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

.unwrap()
.extracting(CookieSyncContext::getBiddersContext)
.extracting(BiddersContext::rejectedBidders)
.isEqualTo(Map.of("requested-bidder", RejectionReason.DISALLOWED_ACTIVITY));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants