From aeeeba83ee141f1c5e6f76fea1485ee1da5fbe64 Mon Sep 17 00:00:00 2001 From: Sander Date: Thu, 5 Nov 2020 18:27:08 +0100 Subject: [PATCH] Optionally read IFA value and add it the the request url (Adhese) (#1563) --- adapters/adhese/adhese.go | 12 ++++++++++-- .../adhese/adhesetest/exemplary/banner-internal.json | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/adapters/adhese/adhese.go b/adapters/adhese/adhese.go index 10aaf6e820d..3938b161726 100644 --- a/adapters/adhese/adhese.go +++ b/adapters/adhese/adhese.go @@ -73,6 +73,13 @@ func extractRefererParameter(request *openrtb.BidRequest) string { return "" } +func extractIfaParameter(request *openrtb.BidRequest) string { + if request.Device != nil && request.Device.IFA != "" { + return "/xz" + url.QueryEscape(request.Device.IFA) + } + return "" +} + func (a *AdheseAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { errs := make([]error, 0, len(request.Imp)) @@ -106,12 +113,13 @@ func (a *AdheseAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapt errs = append(errs, WrapReqError("Could not compose url from template and request account val: "+err.Error())) return nil, errs } - complete_url := fmt.Sprintf("%s%s%s%s%s", + complete_url := fmt.Sprintf("%s%s%s%s%s%s", host, extractSlotParameter(params), extractTargetParameters(params), extractGdprParameter(request), - extractRefererParameter(request)) + extractRefererParameter(request), + extractIfaParameter(request)) return []*adapters.RequestData{{ Method: "GET", diff --git a/adapters/adhese/adhesetest/exemplary/banner-internal.json b/adapters/adhese/adhesetest/exemplary/banner-internal.json index 3a31d0ccf3c..50efe4a656d 100644 --- a/adapters/adhese/adhesetest/exemplary/banner-internal.json +++ b/adapters/adhese/adhesetest/exemplary/banner-internal.json @@ -37,12 +37,15 @@ "publisher": { "id": "123" } + }, + "device": { + "IFA": "dum-my" } }, "httpCalls": [ { "expectedRequest": { - "uri": "https://ads-demo.adhese.com/json/sl_adhese_prebid_demo_-leaderboard/ag55/cigent;brussels/tlall/xtdummy" + "uri": "https://ads-demo.adhese.com/json/sl_adhese_prebid_demo_-leaderboard/ag55/cigent;brussels/tlall/xtdummy/xzdum-my" }, "mockResponse": { "status": 200,