我们已经设置了 prebid.js 客户端来进行标头竞价。标头投标的投标人/参与者详细信息现在在前端硬编码。由于并非所有投标人都参与出版商网站上的所有拍卖,因此我们正在尝试实施一种解决方案,仅从投标前服务器数据库中提取投标人详细信息,并且所有其他信息都将作为 Web 请求的一部分提供。
投标人详细信息以 JSON 对象的形式存储在 Postgres 数据库中,预投标服务器可以与之通信。我们有一个脚本可以根据谷歌电子表格中的配置创建/更新这些 JSON 对象。
我附上了示例 currentRequest(其中所有信息都从客户端发送)、修改请求(通过配置存储的请求 ID 以获取投标人详细信息)和修改请求的响应。
当前请求:
{
"id": "66d72827-812e-4d8d-8a05-4357bb076f3e",
"source": {
"tid": "66d72827-812e-4d8d-8a05-4357bb076f3e"
},
"tmax": 1000,
"imp": [{
"id": "leaderboard",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 970,
"h": 250
}, {
"w": 970,
"h": 90
}, {
"w": 728,
"h": 90
}]
}
}, {
"id": "mpu",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 300,
"h": 600
}, {
"w": 300,
"h": 250
}]
}
}, {
"id": "mpu2",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 300,
"h": 250
}]
}
}, {
"id": "mpu3",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 300,
"h": 250
}]
}
}, {
"id": "advert-section-native-1",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}, {
"id": "advert-section-native-2",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}, {
"id": "advert-section-native-3",
"ext": {
"ncs_appnexus": {
"use_pmt_rule": false,
"placement_id": 18981798
},
"ncs_rubicon": {
"accountId": 7753,
"siteId": 372068,
"zoneId": 2033558
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}],
"test": 0,
"ext": {
"prebid": {
"auctiontimestamp": 1632125682496,
"targeting": {
"includewinners": true,
"includebidderkeys": true
},
"channel": {
"name": "pbjs",
"version": "v$prebid.version$"
},
"cache": {
"vastxml": {}
},
"aliases": {
"ncs_rubicon": "rubicon",
"ncs_appnexus": "appnexus"
}
}
},
"site": {
"publisher": {
"id": "the-sun-web"
},
"page": "https://www.thesun.co.uk/"
},
"device": {
"w": 1680,
"h": 326
},
"user": {
"ext": {
"eids": [{
"source": "pubcid.org",
"uids": [{
"id": "8356598d-e030-4de8-b2ef-b50fff569a71",
"atype": 1
}]
}],
"ConsentedProvidersSettings": {
"consented_providers": "1~"
}
}
},
"regs": {
"ext": {
"gdpr": 0
}
}
}
修改后的请求
{
"id": "66d72827-812e-4d8d-8a05-4357bb076f3e",
"source": {
"tid": "66d72827-812e-4d8d-8a05-4357bb076f3e"
},
"tmax": 1000,
"imp": [{
"ext": {
"prebid": {
"storedrequest": {
"id": "leaderboard"
}
}
},
"banner": {
"format": [{
"w": 970,
"h": 250
}, {
"w": 970,
"h": 90
}, {
"w": 728,
"h": 90
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "mpu"
}
}
},
"banner": {
"format": [{
"w": 300,
"h": 600
}, {
"w": 300,
"h": 250
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "mpu2"
}
}
},
"banner": {
"format": [{
"w": 300,
"h": 250
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "mpu3"
}
}
},
"banner": {
"format": [{
"w": 300,
"h": 250
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "advert-section-native-1"
}
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "advert-section-native-2"
}
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}, {
"ext": {
"prebid": {
"storedrequest": {
"id": "advert-section-native-3"
}
}
},
"banner": {
"format": [{
"w": 1,
"h": 1
}]
}
}],
"test": 1,
"ext": {
"prebid": {
"auctiontimestamp": 1632125682496,
"targeting": {
"includewinners": true,
"includebidderkeys": true
},
"channel": {
"name": "pbjs",
"version": "v$prebid.version$"
},
"cache": {
"vastxml": {}
},
"aliases": {
"ncs_rubicon": "rubicon",
"ncs_appnexus": "appnexus"
}
}
},
"site": {
"publisher": {
"id": "the-sun-web"
},
"page": "https://www.thesun.co.uk/"
},
"device": {
"w": 1680,
"h": 326
},
"user": {
"ext": {
"eids": [{
"source": "pubcid.org",
"uids": [{
"id": "8356598d-e030-4de8-b2ef-b50fff569a71",
"atype": 1
}]
}],
"ConsentedProvidersSettings": {
"consented_providers": "1~"
}
}
},
"regs": {
"ext": {
"gdpr": 0
}
}
}
存储在预投标服务器数据库中的 JSON 对象,用于在修改后的请求中指定的按名称排行榜存储的请求 ID,其格式如下:
{
"id": "leaderboard",
"ext": {
"ncs_rubicon": {
"siteId": 372068,
"zoneId": 2033558,
"accountId": 7753
},
"ncs_appnexus": {
"placement_id": 18981798,
"use_pmt_rule": false
}
}
}
想知道:
- 这种方法的优缺点
- 这是否真的以可扩展的方式工作