Skip to content

Commit cb0486f

Browse files
Forward real client IP in device.ip to PBS
Without this, PBS infers the IP from the incoming connection which is a Fastly edge/data-center IP. Bidders like PubMatic filter data-center IPs as non-human traffic, resulting in 0% fill through Trusted Server. The client IP is already available via get_client_ip_addr() and stored in DeviceInfo.ip — it just wasn't being passed through to the OpenRTB Device object.
1 parent 19c7feb commit cb0486f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/common/src/integrations/prebid.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,13 @@ impl PrebidAuctionProvider {
579579
}),
580580
});
581581

582-
// Build device object with user-agent and geo if available
582+
// Build device object with user-agent, client IP, and geo if available.
583+
// Forwarding the real client IP is critical: without it PBS infers the
584+
// IP from the incoming connection (a data-center / edge IP), causing
585+
// bidders like PubMatic to filter the traffic as non-human.
583586
let device = request.device.as_ref().map(|d| Device {
584587
ua: d.user_agent.clone(),
588+
ip: d.ip.clone(),
585589
geo: d.geo.as_ref().map(|geo| Geo {
586590
geo_type: 2, // IP address per OpenRTB spec
587591
country: Some(geo.country.clone()),

crates/common/src/openrtb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ pub struct Device {
7171
#[serde(skip_serializing_if = "Option::is_none")]
7272
pub ua: Option<String>,
7373
#[serde(skip_serializing_if = "Option::is_none")]
74+
pub ip: Option<String>,
75+
#[serde(skip_serializing_if = "Option::is_none")]
7476
pub geo: Option<Geo>,
7577
}
7678

0 commit comments

Comments
 (0)