Skip to content

TRUSTX2 Bid Adapter : initial release #13044

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

Closed
wants to merge 8 commits into from

Conversation

trustXops
Copy link

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

New Bidder Adapter
Maintainer: [email protected]

Test parameters for validating bids:

bidder: 'trustx2',
params: {
    placement_id: '50000',
    publisher_id: '6000',
    e2etest: true
}

Copy link

Tread carefully! This PR adds 21 linter errors and 1 linter warning (possibly disabled through directives):

  • modules/trustx2BidAdapter.js (+21 errors, +1 warning)

* @typedef {import('../src/adapters/bidderFactory.js').SyncOptions} SyncOptions
*/

const BIDDER_CODE = 'trustx2';
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this is a large mistake; you should endeavor to keep your installed base. See the newspass transition from ozone to aditude backend as an example

}
});

// GDPR
Copy link
Collaborator

@patmmccann patmmccann Apr 29, 2025

Choose a reason for hiding this comment

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

whats with all the redundant uselles logic here? this is a bit of a mess. I think if you delete all the way down to line 150 something you get the same effect

}
});

export const spec = {
Copy link
Collaborator

@patmmccann patmmccann Apr 29, 2025

Choose a reason for hiding this comment

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

where's your gvlid; it is kind of strange to not have one and say you are gdpr compliant.

* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function(serverResponse, bidRequest) {
const userId = deepAccess(serverResponse, 'body.ext.userid');
Copy link
Collaborator

Choose a reason for hiding this comment

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

use optional chaining

imp(buildImp, bidRequest, context) {
const impression = buildImp(bidRequest, context);

if (!impression.bidfloor) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should call the getFloor function explicitly


if (!impression.bidfloor) {
impression.bidfloor = bidRequest.params.bidfloor || 0;
impression.bidfloorcur = bidRequest.params.currency || SUPPORTED_CURRENCY;
Copy link
Collaborator

Choose a reason for hiding this comment

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

i dont think this matches what you have in your doc bidfloorcur: 'USD'

const userId = deepAccess(serverResponse, 'body.ext.userid');
if (userId && config.getConfig('localStorageWriteAllowed')) {
if (storage.localStorageIsEnabled()) {
storage.setDataInLocalStorage(USER_ID_KEY, userId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are you trying to achieve? the shared id does this

*/
interpretResponse: function(serverResponse, bidRequest) {
const userId = deepAccess(serverResponse, 'body.ext.userid');
if (userId && config.getConfig('localStorageWriteAllowed')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

eliminate this getconfig

}

serverResponses.forEach(resp => {
const userSync = deepAccess(resp, 'body.ext.usersync');
Copy link
Collaborator

Choose a reason for hiding this comment

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

optional chaining

return false;
}

const hasMediaType = containsVideoRequest(bidRequest) || hasBannerFormat(bidRequest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is hard to imagine this validation failing bc you listed your supported media types

function isVideoValid(bidRequest) {
// If there's no video no need to validate
if (!containsVideoRequest(bidRequest)) {
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems to stem from the strange && in the valid function above, if you change that to an || you can drop this validation; or just only call this function on video inventory

const params = deepAccess(bidRequest, 'params', {});

if (params && params.e2etest) {
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does this test bypass validations?

...videoConfig,
...videoBidParams // Bidder Specific overrides
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

isnt core doing all these vlaidations already?

export function validateOrtbVideoFields(adUnit, onInvalidParam) {

# Additional Configuration Options

## GPP/GCC Support
TRUSTX 2.0 fully supports Global Privacy Platform (GPP) and Global Cookie Consent (GCC) standards.
Copy link
Collaborator

Choose a reason for hiding this comment

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

what the heck is gcc?

TRUSTX 2.0 fully supports Global Privacy Platform (GPP) and Global Cookie Consent (GCC) standards.

## GDPR, CCPA and other Privacy Regulations
TRUSTX 2.0 is fully compliant with GDPR, CCPA, and other global privacy regulations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is kind of an odd thing to say, how do you know, do you comply with gdpr outside of its geographic scope?

@ChrisHuie ChrisHuie changed the title TRUSTX 2.0 Bidder Adapter TRUSTX2 Bid Adapter : initial release Apr 29, 2025
@trustXops trustXops marked this pull request as draft May 9, 2025 08:07
@patmmccann patmmccann removed their assignment May 30, 2025
@patmmccann
Copy link
Collaborator

Closing as stale

@patmmccann patmmccann closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants