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

Prebid core: fix bug with some native assets being lost from ortb native responses

Open dgirardi opened this issue 3 years ago • 4 comments

Type of change

  • [x] Bugfix

Description of change

For reasons that I don't understand, there are two ways native assets can be retrieved for rendering - getAssetMessage and getAllAssetsMessage. https://github.com/prebid/Prebid.js/pull/8086 only updated one of them, this PR brings the other in line.

It's unclear to me what the impact of this is, except that it currently can only affect bids coming from the Prebid Server adapter (because it's the only one using ortb in native bid responses). I am not sure how many creatives use one way over the other.

dgirardi avatar Aug 04 '22 16:08 dgirardi

@dgirardi we stumbled over those two methods as well and I also do not know why those exist. From a publisher perspective I can say that the getAssetMessage is way better from an API usage perspective. The PUC requests all keys that are found in the template, which gives an easy to debug solution. And prebid.js can provide defaults for requested keys that the bidder has not provided.

Relates to #8773

muuki88 avatar Aug 08 '22 13:08 muuki88

@dgirardi I just used the debugging module to test our native ads and realized the following:

When visiting e.g. https://www.gutefrage.net/frage/bist-du-mit-dem-9-ticket-nach-sylt-gefahren-um-da-party-zu-machen?utm_source=home&utm_medium=question_carousel&utm_campaign=Blickwechsel-Sylt

and pasting

pbjs.setConfig({
  debugging: {
    enabled: true,
    intercept: [{
      when: {
        adUnitCode: 'gf_content_4'
      },
      then: {
        cpm: 10,
        bidderCode: 'yieldlab',
        mediaType: 'native',
        native: {
          clickUrl: 'https://example.com',
          title: 'Click this incredible test ad for you and the world',
          body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea tak',
          image: 'https://native-designs.h5v.eu/assets/stars-1200x627.jpg',
          privacyLink: 'https://yieldlab.com/privacy-platform/'
        }
      }
    }, ]
  }
});

into the console, everything works as expected and the ad is shown in gf_content_4:

Screenshot 2022-08-10 at 16 31 30


However, when adding a cta and/or sponsoredBy nothing happens anymore and slot-level targeting in the Google console is completely empty:

pbjs.setConfig({
  debugging: {
    enabled: true,
    intercept: [{
      when: {
        adUnitCode: 'gf_content_4'
      },
      then: {
        cpm: 10,
        bidderCode: 'smartadserver',
        mediaType: 'native',
        native: {
          clickUrl: 'https://example.com',
          title: 'Click this incredible test ad for you and the world',
          body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea tak',
          image: 'https://native-designs.h5v.eu/assets/stars-1200x627.jpg',
          privacyLink: 'https://yieldlab.com/privacy-platform/', 
          cta: 'click me', 
          sponsoredBy: 'Highfivve'
        }
      }
    }, ]
  }
});

Screenshot 2022-08-10 at 16 36 48

Does your PR fix this issue?

anitaschiller avatar Aug 10 '22 14:08 anitaschiller

It does now @anitaschiller . However I don't know if that's a real problem - it was throwing an error because the response contained assets that were not requested, which should hopefully not happen in practice.

dgirardi avatar Aug 10 '22 15:08 dgirardi

Thanks for the quick debugging @dgirardi . Indeed cta was missing in the native field type. This seems all so very fragile :cry:

muuki88 avatar Aug 10 '22 19:08 muuki88