Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Feature to make top page URL available to any included adapters

Open tomraa opened this issue 9 years ago • 4 comments

Type of issue

feature request

Description

Different bidders' adapters use different techniques to get the current page URL for including in requests for bids to their own systems. When pbjs is delivered in an iframe, some adapters will pick up the iframe URL rather than the top page URL, which the server may not be expecting.

A useful feature would be to support a pbjs property which the adapters could check to see if the developer has set an override page URL to use. For example:

let pageUrlToUse = pbjs.previouslySetOverride || window.location.href

tomraa avatar Nov 24 '17 11:11 tomraa

How about we do this just by estabishing a convention for setConfig()? The page could call setConfig with a well-known attribute. e.g.

pbjs.setConfig(pageUrl: PAGE_URL_OVERRIDE);

Adapters could be modified to look for this attribute:

let pageUrlToUse = config.getConfig("pageUrl") || window.location.href

This would involve no code changes, just an update to the publisher and adapter documentation.

bretg avatar Nov 25 '17 21:11 bretg

@bretg yes that would be good. I am doing something like this already for one bidder, but want to avoid having to maintain local customised versions of every adapter to use an override page URL if the bidder doesn't recognise the iframe URL. If it was an established feature/convention, the adapters here could be updated to use it when the publisher wants to provide it.

tomraa avatar Nov 28 '17 11:11 tomraa

@mkendall07 - we're planning to make this change in the Rubicon Project adapter over the coming couple of weeks, but that's just one of 70-odd bidAdapters in the modules directory. Any ideas for encouraging others to make this a convention that enough adapters use so pubs start using it?

One option would be to just make the change ourselves. Not sure there's precedence for that kind of broad edit. Another would be to make use of the email addresses in the module .md files.

bretg avatar Jan 30 '18 18:01 bretg

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 06 '18 21:03 stale[bot]