prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.33k stars 2.09k forks source link

Bug: Native requests seem to be invalid in v7.13.0 #8974

Closed DianomiJH closed 2 years ago

DianomiJH commented 2 years ago

Type of issue

Bug

Description

Native requests sent from PBJS are invalid in v7.13.0 (and I think all versions down to v7.7.0? haven't tried v7.14.0 yet). using the test page setup described here: https://docs.prebid.org/dev-docs/show-native-ads.html#native-object .

I've tried this using Dianomi's adapter, adform's adapter and the prebid-server adapter and all have issues. What led me to believe it was an issue with pbjs is prebid-server is responding with the error:

'Invalid request: request.imp[0].native.request.assets[3] must define exactly one of {title, img, video, data}'

so it seemed unlikely that it's an issue in adapter land.

Steps to reproduce

setup a test page with a native adunit described in https://docs.prebid.org/dev-docs/show-native-ads.html#native-object and adding a prebid-server config too, (or send a request looking like this (produced by prebidjs) to prebid-server via another route, e.g postman. :

{
  "id": "021fbef5-3ce6-439a-b72c-9fdb78d75ca5",
  "source": {
    "tid": "48ca359f-39c0-471b-9956-167cf13adfec"
  },
  "tmax": 1000,
  "imp": [
    {
      "context": 1,
      "plcmenttype": 1,
      "ext": {
        "tid": "f13639e4-2e33-44c7-a2bc-b58125e86324",
        "prebid": {
          "bidder": {
            "adform": {
              "mid": 1294926,
              "mkv": "category:finance,context:article,context:top"
            },
            "dianomi": {
              "smartadId": 9607,
              "endpoint": "dev-prebid.dianomi.net",
              "test": true
            }
          }
        }
      },
      "id": "postbid_iframe-native",
      "native": {
        "request": "{\"context\":1,\"plcmttype\":1,\"eventtrackers\":[{\"event\":1,\"methods\":[1]}],\"ver\":\"1.2\",\"assets\":[{\"id\":0,\"required\":1,\"img\":{\"type\":3,\"w\":360,\"h\":360}},{\"id\":1,\"required\":1,\"title\":{\"len\":800}},{\"id\":2,\"required\":1,\"data\":{\"type\":1}},{\"id\":3,\"required\":1},{\"id\":4,\"required\":0},{\"id\":5,\"required\":0,\"data\":{\"type\":2}},{\"id\":6,\"required\":0,\"img\":{\"type\":1,\"w\":75,\"h\":75}}]}",
        "ver": "1.2"
      }
    }
  ],
  "test": 0,
  "ext": {
    "prebid": {
      "auctiontimestamp": 1662721180896,
      "targeting": {
        "includewinners": true,
        "includebidderkeys": false
      },
      "channel": {
        "name": "pbjs",
        "version": "v7.13.0-pre"
      },
      "debug": true,
      "aliases": {
        "adform": "adf"
      }
    }
  },
  "site": {
    "publisher": {
      "id": "1"
    },
    "page": "https://dev.dianomi.com/joeharrison/pbs.html?pbjs_debug=true",
    "keywords": "marketviews, retirement",
    "ext": {
      "data": {
        "section": [
          "retirement"
        ]
      }
    }
  },
  "device": {
    "w": 601,
    "h": 834
  },
  "user": {
    "ext": {
      "eids": [
        {
          "source": "pubcid.org",
          "uids": [
            {
              "id": "d099d637-5fe6-4d30-818f-0547b7ff7f38",
              "atype": 1
            }
          ]
        }
      ],
      "consent": "CO-bTt7O-bTt7AZABCENBECsAP_AAP_AACiQHKQAYAAgcoBykAGAAIHKAAA",
      "data": {
        "ucat": [
          "test"
        ]
      }
    }
  },
  "regs": {
    "ext": {
      "gdpr": 1,
      "us_privacy": "1---"
    }
  },
  "content": {
    "context": 1
  }
}

)

Test page

https://jsfiddle.net/qLe1zbvt/

Expected results

native assets to be valid and prebid-server to accept them

Actual results

error from prebid-server: 'Invalid request: request.imp[0].native.request.assets[3] must define exactly one of {title, img, video, data}'

Platform details

tested in versions 7.6 to 7.13 (7.6 seemed to work, all others didn't)

Other information

dgirardi commented 2 years ago

8977 should fix this. Before that, a workaround is to remove clickUrl and privacyLink from the native adUnit definition: at least for prebid server, they have no effect apart from triggering this bug (clickUrl is required by the underlying protocol, so requesting it makes no difference. privacyLink is - I believe - not supported by the PBS adapter, at least in the sense that support for it is not signaled in the request.).