Skip to content

Conversation

@softcoder594
Copy link
Contributor

@softcoder594 softcoder594 commented Sep 26, 2025

🔧 Type of changes

  • new bid adapter
  • bid adapter update
  • new feature
  • new analytics adapter
  • new module
  • module update
  • bugfix
  • documentation
  • configuration
  • dependency update
  • tech debt (test coverage, refactorings, etc.)

✨ What's the context?

Improve module behavior:

  1. Introduce merge policies for the case when original request already contains an optable-inserted (that is when inserter==optable) EID with the same source as the one obtained from Optable Targeting API. By default the module will skip such EIDs - i.e. will not replace or merge and will just relay the EID from the client as is. However it can be configured per source to either merge or replace or remove such EIDs via optable-inserter-eids-merge or optable-inserter-eids-replace or optable-inserter-eids-ignore correspondingly.

  2. Pass an original User Agent and a client/server flag in the Targeting API request in order for Optable Targeting Server to differentiate the logs by source.

Optable EID Merging Rules:

  1. Skip the server-side EID (default behavior).
  2. Merge UIDs within the EID, if EID's source is part of the optable-inserter-eids-merge config param.
  3. Replace the EID with the one obtained from Targeting API, if EID's source is part of the optable-inserter-eids-replace config param.
  4. Remove EIDs within the EID, if EID's source is part of the optable-inserter-eids-ignore config param.

optable-inserter-eids-merge, optable-inserter-eids-replace and `optable-inserter-eids-ignore are take an array of strings, where each item corresponds to a EID source value for which the rule is applicable.

🧠 Rationale behind the change

More accurate ranging of incoming traffic

🧪 Test plan

Unit Tests
Manual Integration Tests

🏎 Quality check

  • Are your changes following our code style guidelines?
  • Are there any breaking changes in your code? No
  • Does your test coverage exceed 90%?
  • Are there any erroneous console logs, debuggers or leftover code in your changes? No

@osulzhenko osulzhenko requested a review from CTMBNara September 29, 2025 07:29
@softcoder594 softcoder594 marked this pull request as ready for review October 3, 2025 15:31
CTMBNara
CTMBNara previously approved these changes Oct 6, 2025
Comment on lines 150 to 151
final String inserter = Optional.ofNullable(eid.getInserter()).orElse("");
return "%s_%s".formatted(inserter, eid.getSource());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Previous approach with ObjectUtil.getIfNotNullOrDefault a bit confused me, please change to this:

return "%s_%s".formatted(StringUtils.defaultString(eid.getInserter()), eid.getSource());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@CTMBNara CTMBNara merged commit aa4f82a into prebid:master Oct 21, 2025
8 checks passed
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