Expected s2s Behaviour

  • The MediaGrid expects HTTP 200, 204, or 302 responses to s2s calls, if you have recorded a valid impression.

  • If The MediaGrid receives a response code > 399, i.e. HTTP 4xx, or 5xx, it denotes the impression as not properly recorded on the Buyer side, and will lead to discrepancies between The MediaGrid and the Buyer.

  • If the response code is >= 400, or there was a timeout, The MediaGrid makes 1 retry to check if a valid impression was recorded on the Buyer side.

s2s Headers

When sending s2s impression calls, The MediaGrid uses the following headers.

  • User-Agent: Indicates that the impression call is relayed by The MediaGrid, this is always BidSwitch/1.0.

  • X-User-Agent: Specifies the application type, operating system, software vendor or software version of the original request.

  • X-Forwarded-For: Identifies the originating IP address.

  • X-TMG-ServerUpstream: A value of 1 indicates that the original impression call to The MediaGrid was from a server.

# Example of s2s headers from burl imp request
X-Forwarded-For: 77.16.215.3, 18.196.6.164
X-TMG-ServerUpstream: 1
User-Agent: BidSwitch/1.0
X-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 [FBAN/FBIOS;FBAV/179.0.0.50.82;FBBV/116150041;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/11.2.1;FBSS/2;FBCR/Telenor;FBID/phone;FBLC/nb_NO;FBOP/5;FBRV/0]

Use the following table to compare the s2s vs u2s headers The MediaGrid applies in each circumstance.

BidSwitch s2s and u2s HTTP Headers

SSP to DSP

s2s:s2s_nurl in request or adslot

s2s:burl in response

u2s

s2s

User-Agent: BidSwitch/1.0
X-TMG-ServerUpstream: 1
User-Agent: BidSwitch/1.0
X-TMG-ServerUpstream: 1
X-User-Agent: (applied from user in most cases)
X-Forwarded-For:

n/a; s2s forwarded as s2s only

u2s

User-Agent: BidSwitch/1.0
X-Forwarded-For:
X-User-Agent: (applied from user)
User-Agent: BidSwitch/1.0
X-Forwarded-For:
X-User-Agent: (applied from user)
X-Forwarded-For:
X-User-Agent: See u2s note

Note

u2s: In all other scenarios which the table outlines, The MediaGrid applies its own headers. Except in the u2s case, where it forwards the initial u2s call without any alteration.