prebid / prebid-universal-creative

Apache License 2.0
43 stars 71 forks source link

Replace missing native assets with empty strings #171

Closed anitaschiller closed 2 years ago

anitaschiller commented 2 years ago

See the following issue and closed PR for Prebid.js.

Instead of replacing missing native assets in Prebid Core, all remaining placeholders in the template are now directly replaced by empty strings in the nativeAssetManager.

After replacing the placeholders with existing assets, all placeholders available in the original template are searched for again and if still found, replaced by an empty string.

I also extracted the typeof win.pbNativeData !== 'undefined' flag to a function. I'm not 100% sure what it does but I suppose it checks if the template is a GAM template? I hope I used it the right way.

Thanks for your review!