diff --git a/adapters/sharethrough/butler.go b/adapters/sharethrough/butler.go index 61081aaa3ff..522bbc4967e 100644 --- a/adapters/sharethrough/butler.go +++ b/adapters/sharethrough/butler.go @@ -7,6 +7,7 @@ import ( "github.com/prebid/prebid-server/adapters" "github.com/prebid/prebid-server/errortypes" "github.com/prebid/prebid-server/openrtb_ext" + "github.com/prebid/prebid-server/privacy/ccpa" "net/http" "net/url" "regexp" @@ -21,6 +22,7 @@ type StrAdSeverParams struct { BidID string ConsentRequired bool ConsentString string + USPrivacySignal string InstantPlayCapable bool Iframe bool Height uint64 @@ -94,6 +96,11 @@ func (s StrOpenRTBTranslator) requestFromOpenRTB(imp openrtb.Imp, request *openr return nil, err } + usPolicySignal := "" + if usPolicy, err := ccpa.ReadPolicy(request); err == nil { + usPolicySignal = usPolicy.Value + } + return &adapters.RequestData{ Method: "POST", Uri: s.UriHelper.buildUri(StrAdSeverParams{ @@ -101,6 +108,7 @@ func (s StrOpenRTBTranslator) requestFromOpenRTB(imp openrtb.Imp, request *openr BidID: imp.ID, ConsentRequired: s.Util.gdprApplies(request), ConsentString: userInfo.Consent, + USPrivacySignal: usPolicySignal, Iframe: strImpParams.Iframe, Height: height, Width: width, @@ -184,6 +192,9 @@ func (h StrUriHelper) buildUri(params StrAdSeverParams) string { v.Set("bidId", params.BidID) v.Set("consent_required", fmt.Sprintf("%t", params.ConsentRequired)) v.Set("consent_string", params.ConsentString) + if params.USPrivacySignal != "" { + v.Set("us_privacy", params.USPrivacySignal) + } if params.TheTradeDeskUserId != "" { v.Set("ttduid", params.TheTradeDeskUserId) } diff --git a/adapters/sharethrough/butler_test.go b/adapters/sharethrough/butler_test.go index 40c59b50442..402e8365dd0 100644 --- a/adapters/sharethrough/butler_test.go +++ b/adapters/sharethrough/butler_test.go @@ -437,6 +437,7 @@ func TestBuildUri(t *testing.T) { BidID: "bid", ConsentRequired: true, ConsentString: "consent", + USPrivacySignal: "ccpa", InstantPlayCapable: true, Iframe: false, Height: 20, @@ -450,6 +451,7 @@ func TestBuildUri(t *testing.T) { "bidId=bid", "consent_required=true", "consent_string=consent", + "us_privacy=ccpa", "instant_play_capable=true", "stayInIframe=false", "height=20", diff --git a/adapters/sharethrough/sharethrough.go b/adapters/sharethrough/sharethrough.go index d1b2408ce66..5e0377ab27a 100644 --- a/adapters/sharethrough/sharethrough.go +++ b/adapters/sharethrough/sharethrough.go @@ -10,7 +10,7 @@ import ( ) const supplyId = "FGMrCMMc" -const strVersion = 7 +const strVersion = 8 func NewSharethroughBidder(endpoint string) *SharethroughAdapter { return &SharethroughAdapter{