@@ -55,7 +55,8 @@ export const spec = {
55
55
} ) ;
56
56
const payload = {
57
57
codes : codes ,
58
- referer : encodeURIComponent ( bidderRequest . refererInfo . referer )
58
+ referer : encodeURIComponent ( bidderRequest . refererInfo . referer ) ,
59
+ pbjs : '$prebid.version$'
59
60
} ;
60
61
if ( bidderRequest ) { // modules informations (gdpr, ccpa, schain, userId)
61
62
if ( bidderRequest . gdprConsent ) {
@@ -116,6 +117,9 @@ export const spec = {
116
117
if ( 'match' in value ) {
117
118
bidResponse [ 'mediasquare' ] [ 'match' ] = value [ 'match' ] ;
118
119
}
120
+ if ( 'hasConsent' in value ) {
121
+ bidResponse [ 'mediasquare' ] [ 'hasConsent' ] = value [ 'hasConsent' ] ;
122
+ }
119
123
if ( 'native' in value ) {
120
124
bidResponse [ 'native' ] = value [ 'native' ] ;
121
125
bidResponse [ 'mediaType' ] = 'native' ;
@@ -153,19 +157,22 @@ export const spec = {
153
157
*/
154
158
onBidWon : function ( bid ) {
155
159
// fires a pixel to confirm a winning bid
156
- let params = [ ] ;
160
+ let params = { 'pbjs' : '$prebid.version$' } ;
157
161
let endpoint = document . location . search . match ( / m s q _ t e s t = t r u e / ) ? BIDDER_URL_TEST : BIDDER_URL_PROD ;
158
162
let paramsToSearchFor = [ 'cpm' , 'size' , 'mediaType' , 'currency' , 'creativeId' , 'adUnitCode' , 'timeToRespond' , 'requestId' , 'auctionId' ]
159
163
if ( bid . hasOwnProperty ( 'mediasquare' ) ) {
160
- if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'bidder' ) ) { params . push ( 'bidder=' + bid [ 'mediasquare' ] [ 'bidder' ] ) ; }
161
- if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'code' ) ) { params . push ( 'code=' + bid [ 'mediasquare' ] [ 'code' ] ) ; }
162
- if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'match' ) ) { params . push ( 'match=' + bid [ 'mediasquare' ] [ 'match' ] ) ; }
164
+ if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'bidder' ) ) { params [ 'bidder' ] = bid [ 'mediasquare' ] [ 'bidder' ] ; }
165
+ if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'code' ) ) { params [ 'code' ] = bid [ 'mediasquare' ] [ 'code' ] ; }
166
+ if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'match' ) ) { params [ 'match' ] = bid [ 'mediasquare' ] [ 'match' ] ; }
167
+ if ( bid [ 'mediasquare' ] . hasOwnProperty ( 'hasConsent' ) ) { params [ 'hasConsent' ] = bid [ 'mediasquare' ] [ 'hasConsent' ] ; }
163
168
} ;
164
169
for ( let i = 0 ; i < paramsToSearchFor . length ; i ++ ) {
165
- if ( bid . hasOwnProperty ( paramsToSearchFor [ i ] ) ) { params . push ( paramsToSearchFor [ i ] + '=' + bid [ paramsToSearchFor [ i ] ] ) ; }
170
+ if ( bid . hasOwnProperty ( paramsToSearchFor [ i ] ) ) {
171
+ params [ paramsToSearchFor [ i ] ] = bid [ paramsToSearchFor [ i ] ] ;
172
+ if ( typeof params [ paramsToSearchFor [ i ] ] == 'number' ) { params [ paramsToSearchFor [ i ] ] = params [ paramsToSearchFor [ i ] ] . toString ( ) }
173
+ }
166
174
}
167
- if ( params . length > 0 ) { params = '?' + params . join ( '&' ) ; }
168
- ajax ( endpoint + BIDDER_ENDPOINT_WINNING + params , null , undefined , { method : 'GET' , withCredentials : true } ) ;
175
+ ajax ( endpoint + BIDDER_ENDPOINT_WINNING , null , JSON . stringify ( params ) , { method : 'POST' , withCredentials : true } ) ;
169
176
return true ;
170
177
}
171
178
0 commit comments