prebid / prebid-universal-creative

Apache License 2.0
43 stars 71 forks source link

Feature Request: Have the PUC find the $$PREBID_GLOBAL$$ #168

Open ethyde opened 2 years ago

ethyde commented 2 years ago

Hello everyone,

It's not very clear following this issue https://github.com/prebid/prebid-universal-creative/issues/51. How can we customize the $$PREBID_GLOBAL$$ name without having to create a custom build?

dgirardi commented 2 years ago

When using safeframes there is no dependency on the prebid global. Otherwise, in some situations the creative will try to find and call [global].renderAd(). This, or at least the documentation for this, should be improved.

ethyde commented 2 years ago

Hello,

If I understand well, whatever the namespace of pbjs, UC should be able to find it and use it if necessary?

pm-harshad-mane commented 2 years ago

Not sure whether you are looking for this, but changing the name here and building the project will allow you to use another name than pbjs https://github.com/prebid/prebid-universal-creative/blob/master/package.json#L20 Make sure you are using the same prebid-name-space in PrebidJS too.

ethyde commented 2 years ago

Thanks for yours reply @pm-harshad-mane et @dgirardi :) So I have to fork or clone this repo to be able to customize the global namespace?

patmmccann commented 2 years ago

For now yes, but we'll keep this issue open to track identifying the global similar to https://github.com/prebid/Prebid.js/blob/master/src/prebidGlobal.js

Hamper commented 1 year ago

I think that can be usable to implement some parameter for PUC like ucTagData.prebidName = 'pbjs'

andyblackwell commented 6 months ago

yeah, that method could even support multiple custom prebid instances on a page by passing a key/val along with each unit when setting targeting, like your example, pbjsGlobal = onePbjs on one ad request and pbjsGlobal = twoPbjs on another, PUC could directly know which version a render call needs to be sent to by default, no custom PUC build necessary