InteractiveAdvertisingBureau / Global-Privacy-Platform

IAB Tech Lab Global Privacy Platform specification
74 stars 38 forks source link

Updates needed to better support vendor scripts within iframes calling the CMP #51

Closed nealrosen closed 1 year ago

nealrosen commented 1 year ago

Problem

As currently designed, vendor scripts running within an iframe are unable to get responses from most commands. Most commands do not support callbacks, but the example stub code assumes all commands do support callbacks.

Also, given that most commands use synchronous return values as opposed to asynchronous callback functions adds complexity for vendor scripts running inside iframes. A proxy interface (similar to one defined in the TCF design) can not be created in a way that allows vendor scripts to call the proxy the same way they would call the real CMP. This is due to the fact that all cross-frame communication is inherently asynchronous.

Solution 1 (recommended) - Remove direct return values from all commands and rely solely on callbacks

Pros

Cons

Solution 2 - Leave CMP interface as is. Update example stub code to respond to postMessage calls with direct return values as well as callbacks from the command.

Pros

Cons

Solution 3 - Update all commands to support both a return value and a callback. If a callback is passed, then the command should use it. Otherwise, the command should return a value.

Pros

Cons

While I believe Solution 1 should be the preferred approach, if there is too much concern making significant changes at this time, Solution 3 may be sufficient (though not ideal).

janwinkler commented 1 year ago

Followup: Group decision to go with suggestion 1 as outlined above. We will draft the necessary changes and input to the WG.

ajsf commented 1 year ago

Hello,

I am checking in to see if there is an estimated date for when this update will be released? I see that PR https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/pull/55 has been submitted for this.

At FreeWheel we are waiting for this update to implement GPP in our SDK.

Thanks, Aaron