Skip to content
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

Permutive RTD submodule: TrustX update #7001

Merged
merged 7 commits into from
Jul 28, 2021

Conversation

dreischer
Copy link
Contributor

Update to how Permutive passes segments to the TrustX adapter

Type of change

  • Other

@patmmccann
Copy link
Collaborator

patmmccann commented Jun 10, 2021

Can you start setting the global ortb2 object? All these custom sets are not ideal, as you point out

#6290 (comment)

There appears to be an agreement this is coming soon in the original review

#6290 (review)

Fwiw we have held other rtd submodules until they meet this requirement, eg digital Garage and sirdata.

@dreischer
Copy link
Contributor Author

Can you start setting the global ortb2 object? All these custom sets are not ideal, as you point out

#6290 (comment)

Thanks for picking this up @patmmccann

TrustX have asked us to provide the data in specifically this format - @PWyrembak please let me know if you'd like us to stick with the structure in this PR, or to change it to something like

pbjs.setBidderConfig({
  bidders: ['trustX'],
  config: {
    ortb2: {
      user: {
        data: [{
          name: 'permutive.com',
          segment: [
            { id: '1' }
          ]
        }]
      }
    }
  }
})

(or we could do both in parallel)

@patmmccann
Copy link
Collaborator

I have no worries with you setting things in a specific way for any specific adapter as long as you also set global. We don't want RTD submodules becoming kingmakers of which bid adapters have access to seller defined audiences and which do not.

@dreischer
Copy link
Contributor Author

@patmmccann - We want to give publishers the control of where to send specific segments to. For example, let's say a publisher creates a custom segment for a specific campaign and they're transacting with the buyer via a PMP in Xandr. If they only enable the Xandr activation for this segment in Permutive, we won't push the segment ID to any other SSP. This means (1) we define the key-value <> segment name mapping only in Xandr and (2) we push the respective segment ID only into the Xandr request on page.

It's similar for this PR: The publisher will need to explicitly instruct us to send a certain set of segments to TrustX. And these segment IDs wouldn't be of much value to other bidders, because they are created for specific use-cases and they're arbitrary IDs.

I'm very supportive of using the config.ortb2.user.data as a proper field for segments, instead of using key-values. The blocker right now is that ortb2 isn't supported by the SSPs we integrate with (both in Prebid and to use it for deal targeting) or that only specific segment taxonomies are supported. Regarding your point on making segments available globally: We have the requirements from publishers to send specific segments to specific SSPs. I don't believe that our clients necessarily want to share their segments with all bidders. So when using config.ortb2.user.data we will most likely do it via setBidderConfig so we can respect the publisher configuration. I don't want to sidetrack this PR too much - but if anything is unclear I'd be happy to continue the conversation via email or an issue on GitHub.

@Fawke
Copy link
Contributor

Fawke commented Jun 15, 2021

The changes made in this PR looks good. But, I'd wait for @bretg to review as well. If I'm not wrong, I think he wrote a comment in one of your earlier PRs to set the data to both key/value pair and the ortb2 object.

@bretg
Copy link
Collaborator

bretg commented Jun 17, 2021

It's ok if the bid adapter don't look at the standard location -- you can set it there anyhow. This solves the chicken/egg problem. Hopefully we can guilt them over time to getting it from the right place.

Here's what we want to see:

  1. update your code so that when you set bidder-specific params, you also call pbjs.setBidderConfig() for that specific adapter like what's note above.

  2. Update your documentation .md file to reflect this

  3. Add a docs file in https://github.com/prebid/prebid.github.io/tree/master/dev-docs/modules/permutiveRtdProvider.md similar to other RTD module docs in that folder

Please work with Steve Francolla to determine the right syntax for the user.data[]. Permutive will need a segtax value -- Steve's the chair of the Prebid Taxonomy committee so should be able to make this happen.

This all said, if you are on a tight timeline for TrustX, we could accept a promise to make this change in a near-future release.

@PWyrembak
Copy link
Contributor

Hi @dreischer @bretg
We just made this PR #7055 that add support for TrustX adapter to read Permutive segments from ortb2.user.data. From our POV this object works the best for this purpose so wanted to make sure we are aligned on both PRs.

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

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

LGTM.

@patmmccann
Copy link
Collaborator

patmmccann commented Jun 22, 2021

#7074 appears to be an example of the poor behavior permutive is encouraging. I would suggest we hold this pr, 7074, and any other customizations related to permutive until they are in compliance.

We don't want every bidder having to make a pr to support permutuve and another to support ortb2 object.

@dreischer
Copy link
Contributor Author

@PWyrembak that's great thanks. I've update the integration so we now use ortb2.user.data. It seems to work as expected.

@bretg Does this update look good to you? I had two questions:

  1. Is there a better way to get the bidder config first, so we can merge into it? I'm worried that right now we're overwriting, but maybe .setBidderConfig() does a merge in the background anyway?
  2. I had to remove the TrustX test, as we don't modify the bid object anymore. And I'm not sure there's another way to check since there's no .getBidderConfig() function. Any advice?

I'd be happy to set data for the other bidders the same way if that's preferred. As far as I'm aware the Magnite bidder will just filter it out and the Ozone and Xandr don't support it, but I guess it doesn't hurt if it's there. My only concern is how we can cover it with tests while it's not supported, but that is wider question anyway (question 2 above)

Thanks for the reminder for the dev-docs page @bretg - I'll make sure we get a PR for that

@dreischer
Copy link
Contributor Author

@patmmccann I wasn't familiar with the PR you linked. But after taking a quick look it seems as if the PR is adding support for ortb2.user.data. Today the Permutive submodule does not connect to Pubmatic. But if their adapter now supports ortb2.user.data and they're also adding Pubmatic to the Permutive submodule, then I agree that we should use the same pattern as my last commit on this PR (pending @bretg's feedback). So it would look something like this:

pubmatic: function (bid, data, acEnabled) {
  if (acEnabled && data.ac && data.ac.length) {
    setBidderRtb('pubmatic', data.ac)
  }
}

@patmmccann
Copy link
Collaborator

patmmccann commented Jun 22, 2021 via email

@bretg
Copy link
Collaborator

bretg commented Jun 22, 2021

@dreischer - the requirements are:

  • No RTD module can favor a particular bidder.
  • All modules must support standard conventions for FPD, video, schain, coppa, etc.

That said, if you have to do special logic for certain bidders, not ideal, but it's ok as long as it's publisher-configurable and standard conventions are followed in addition to whatever special stuff is needed.

In your case:

  1. if a bidder is defined in acBidders
  2. write the data to the special place AND to user.data for that bidder.
  3. if the publisher adds a bidder to the acBidders list that your module doesn't recognize, you still have to add an element to user.data for that bidder

You have two choices for writing to user.data on a per-bidder basis:

  1. use getBidderConfig() to find the current custom config for a given bidder
    a) merge a new ortb2.user.data object
    b) write it back with setBidderConfig()
    c) then Patrick and I start yelling at the bidders instead of you
  2. help us improve the RTD module infrastructure by supporting the bidder-specific use-case rather than having to use setBidderConfig.
    a) This could be done by adding a "bidRequest" event listener to https://docs.prebid.org/dev-docs/add-rtd-submodule.html#using-event-listeners

Some questions that could be asked about your module:

  • is it really necessary to wait until getBidRequestData to get your segments? Seems to me like user segments don't depend on adunit -- you should be able to retrieve them immediately on init instead of waiting for an auction
  • if you can rewire your module to get segment data up-front (maybe checking for updated data at each auction_init event?) then adding a new "bidRequest" listener to the infrastructure would make sense.

@@ -93,25 +93,6 @@ describe('permutiveRtdProvider', function () {
})
}
})
it('sets segment targeting for TrustX', function () {
Copy link
Collaborator

@patmmccann patmmccann Jun 23, 2021

Choose a reason for hiding this comment

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

You're just deleting tests, you need to replace them with new tests

@@ -121,16 +125,34 @@ function getDefaultBidderFn (bidder) {
},
trustx: function (bid, data, acEnabled) {
if (acEnabled && data.ac && data.ac.length) {
deepSetValue(bid, 'params.keywords.p_standard', data.ac)
setBidderRtb('trustx', data.ac)
Copy link
Collaborator

@patmmccann patmmccann Jun 23, 2021

Choose a reason for hiding this comment

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

This is the exact logic to pass data to any generic bidder, instead of whitelabeling just trustx, please make bidder name configurable so publishers can call this function for any bidder.

This would make #7074 unnecessary

@bretg
Copy link
Collaborator

bretg commented Jun 25, 2021

Spoke with @dreischer about this - the plan is to work in the getBidderConfig solution above.

For the record the 2nd option doesn't work because this value is global, not per-adunit.

@dreischer
Copy link
Contributor Author

Hey @bretg - the latest commit includes the changes we discussed: We now set ortb2.user.data for all the bidders defined by the publisher. We use the onAuctionInitEvent hook for this. We also kept the getBidRequestData hook for those bidders where we still need to modify the bid object to set custom parameters because they don't yet support the other route (we do however still set ortb2.user.data for them in parallel). If you're happy with this I'll also create the PR for the dev docs page. Thanks!

@lgtm-com
Copy link

lgtm-com bot commented Jul 15, 2021

This pull request introduces 1 alert when merging 1b1e0e8 into ad36dcd - view on LGTM.com

new alerts:

  • 1 for Superfluous trailing arguments

Copy link
Collaborator

@bretg bretg left a comment

Choose a reason for hiding this comment

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

thanks @dreischer - it would be help to note in the docs what data is set -- this module will be a template for others.

@dreischer
Copy link
Contributor Author

Thanks for reviewing @bretg - I now also updated the readme as of your suggestion

@Fawke Fawke merged commit 3bbcf66 into prebid:master Jul 28, 2021
prebidtappx pushed a commit to prebidtappx/Prebid.js that referenced this pull request Nov 15, 2021
* Update Premutive <> TrustX integration

* remove old TrustX code

* use ortb2 for trustx

* enable ortb2 setBidderConfig

* remove superfluous argument

* Readme update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants