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

IX Bid Adapter: POST Support #9032

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

lksharma
Copy link
Collaborator

Type of change

  • Bugfix

  • Feature

  • New 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

This release supports the switch from GET to POST requests via features


Be sure to test the integration with your adserver using the [Hello World](/integrationExamples/gpt/hello_world.html) sample page. -->


## Other information
@lksharma: [email protected]

features: toggles
}
if (storage.localStorageIsEnabled()) {
storage.setDataInLocalStorage(LOCAL_STORAGE_FEATURE_TOGGLES_KEY, JSON.stringify(this.featureToggles));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it useful to read these values from local storage instead of relying on configuration

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

enabling post is dependent on our server response for the moment. We are reading from an internal config and local storage when available. The advantage of reading from local storage is we can capture requests on page load rather than waiting for a response.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@patmmccann let me know if you have any additional questions.

Copy link
Collaborator

@patmmccann patmmccann Sep 30, 2022

Choose a reason for hiding this comment

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

setting ix_features: {"expiry":,"features":{"pbjs_enable_post":{"activated":true}}}

in local storage and giving a bidder an override to access local storage to enable post method seems to be a bizarre workflow for a publisher and also seems undocumented. I feel like I must be missing something here. Why couldn't the publisher opt into IX post mode via a more standard method?

We're attempting to minimize bidder access to local storage and make it a rare event, not standard practice.

Copy link
Collaborator Author

@lksharma lksharma Oct 3, 2022

Choose a reason for hiding this comment

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

@patmmccann

We won't be relying on local storage to activate POST. Local storage access will allow us to generate POST requests on page load but this is not a dependency and is more of a nice to have.

If reading from local storage is not allowed then POST will be limited to ad refreshes on the page (since pbjs_enable_post flag is dependent on our server response). In a future PR, we will be moving completely to POST. The intention here is to roll out POST within our adapter gradually.

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 an unsatisfying reason; we'll discuss in committee. I recommend you plan on this not being approved.

Copy link
Collaborator Author

@lksharma lksharma Oct 5, 2022

Choose a reason for hiding this comment

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

Is the use of local storage the concern here? If so, would refactoring to remove the usage of local storage help address those concerns?

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Hi @lksharma

While I think the overall code looks fine (baring Patrick's feedback about the localStorage question), I was hoping to test these changes to verify the POST request completes successfully.

Do you have some sample params I can use that should invoke this state? I was trying with some of the values in the md file and hardcoding some values in localStorage, but I'd rather test with the expected natural workflow, if possible. Please let me know when you have the chance.

Thanks.

@lksharma
Copy link
Collaborator Author

lksharma commented Sep 29, 2022

@jsnellbaker,

Thanks for looking into this. You can test the code flow with the following local storage value:

ix_features: {"expiry":<TIMESTAMP>,"features":{"pbjs_enable_post":{"activated":true}}}

TIMESTAMP = new Date().setHours(new Date().getHours() + 1)
^ sets the expiry value to an hour.

Let me know if you need anything else.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback @lksharma

With that in place in the localStorage (and the bidderSettings storageAllowed setting enabled), the logic presented here appears to be working fine.

Will wait on merging for Patrick's feedback.

@patmmccann
Copy link
Collaborator

patmmccann commented Sep 30, 2022

Generally, this use of local storage is not a rules violation, but it feels bizarre and difficult to explain to publishers, who will have to grant you access to local storage one by one. I recommend retooling to avoid these conversations and to give publishers a simpler way to enable post mode. Since Prebid 7 was released, your adapter will not have access to local storage by default.

@patmmccann
Copy link
Collaborator

patmmccann commented Oct 5, 2022

spoke with Luke at IX, merging

The use of local storage is not critical to the server side control of get vs post, but enhances it. The feature will still work for publishers who don't make an exception.

@patmmccann patmmccann merged commit 9ea583a into prebid:master Oct 5, 2022
JacobKlein26 pushed a commit to nextmillenniummedia/Prebid.js that referenced this pull request Feb 9, 2023
jorgeluisrocha pushed a commit to jwplayer/Prebid.js that referenced this pull request May 23, 2023
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.

None yet

4 participants