Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBJS support for enhanced PBS analytics #9248

Closed
bretg opened this issue Nov 15, 2022 · 4 comments
Closed

PBJS support for enhanced PBS analytics #9248

bretg opened this issue Nov 15, 2022 · 4 comments
Assignees
Labels

Comments

@bretg
Copy link
Collaborator

bretg commented Nov 15, 2022

Type of issue

enhancement

Description

Client-side analytics adapters don't have access to what actually happened with PBS bids unless they're successful. The Prebid Server team is working on an enhancement that implements a new optional request flag that instructs PBS to include the status of all bid attempts in the response.

Publishers would opt-in to the additional analytics data because it could increase the size of the payload from Prebid Server by a few percent.

They would opt-in by setting up the appropriate s2sConfig:

pbjs.setConfig({
  s2sConfig: [{
    ...
    extPrebid: {
      returnallbidstatus: true
    }
  }]
});

When this flag is true, PBS will return the additional ext.seatnonbid JSON as described in the PBS issue.

Note that the IAB is discussing this proposed seatnonbid syntax, so it could possibly change somewhat in the coming months, though we don't expect any significant changes.

Prebid.js Work

  1. The pbsBidAdapter (or the new ORTB library?) needs to be able to read ext.seatnonbid and create the corresponding Prebid.js bid response data structures. e.g. no-bid, timeout, error. These structures should carry the detailed reason status code. Note that it should enforce allowUnknownAdapters as it would for seatbids.
    • statuscodes 1-99: No-Bid
    • statuscodes 100-199: Error
    • statuscodes 200-299: Request Blocked
    • statuscodes 300-399: Response Rejected
  2. Analytics adapters should be able to read this enhanced server-side response data, including the more detailed status codes.
  3. Since the IAB is discussing this extension as a standard, we should consider providing a mechanism for client-side bid adapters to report the same level of status code reporting. i.e. a PBJS bid adapter could report seatnonbid statuscode 8, which is no-bid due to unmatched user.

Test Cases

  1. PBS returns a mix of seatbid and seatnonbid
{
	"seatbid": [{
		"seat": "bidderB",
		"bid": [{
			"id": "613673EF-A07C-4486-8EE9-3FC71A7DC73D",
			"impid": "adunit-code-2",
			"price": 1.00,
			"adm": "<html>Hello World</html>",
			"adomain": [
				"www.addomain.com"
			],
			"ext": {
				"prebid": {
					"meta": {
						"adaptercode": "bidderB"
					}
				}
			}
		}]
	}],
	"ext": {
		"seatnonbid": [{
			"seat": "bidderA",
			"ext": {
				"prebid": {
					"meta": {
						"adaptercode": "bidderM"
					}
				}
			},
			"nonbid": [{
				"impid": "adunit-code-1",
				"statuscode": 8
			}, {
				"impid": "adunit-code-2",
				"statuscode": 8
			}]
		}, {
			"seat": "bidderB",
			"ext": {
				"prebid": {
					"meta": {
						"adaptercode": "bidderB"
					}
				}
			},
			"nonbid": [{
				"impid": "adunit-code-1",
				"statuscode": 1
			}]
		}]
	}
}
  1. PBS returns only seatnonbid
{
    "ext": {
        "seatnonbid": [
            {
                "seat": "bidderA",
                "ext": {
                    "prebid": {
                        "meta": {
                            "adaptercode": "bidderM"
                        }
                    }
                },
                "nonbid": [
                    {
                        "impid": "adunit-code-1",
                        "statuscode": 8
                    },
                    {
                        "impid": "adunit-code-2",
                        "statuscode": 8
                    }
                ]
            },
            {
                "seat": "bidderB",
                "ext": {
                    "prebid": {
                        "meta": {
                            "adaptercode": "bidderB"
                        }
                    }
                },
                "nonbid": [
                    {
                        "impid": "adunit-code-1",
                        "statuscode": 1
                    },
                    {
                        "impid": "adunit-code-2",
                        "statuscode": 301
                    }
                ]
            }
        ]
    }
}
@patmmccann
Copy link
Collaborator

Is it possible to generalize support for nobid reasons that follow ortb2?

@bretg
Copy link
Collaborator Author

bretg commented Dec 1, 2022

This "ext.seatnonbid" structure is a draft IAB extension proposal that @SyntaxNode is championing in the working group. It's possible there might be changes before coming out of draft. The bulk of the Prebid.js work involved would be unlikely to change no matter what the JSON structure winds up being. Bobby's going to be proposing an extension to the PBJS internals to include a "bidNonResponse" structure that can be populated by the pbsBidAdapter as well as regular client-side adapters. The way PBJS currently handles the currency and floor situations is a bit of a hack. We'll be looking to normalize this, maybe in phases.

@ChrisHuie
Copy link
Collaborator

#9453

@bretg
Copy link
Collaborator Author

bretg commented Mar 27, 2023

Confirmed docs in prebid/prebid.github.io#4357 -- closing.

@bretg bretg closed this as completed Mar 27, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in Prebid.js Tactical Issues table Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants