Skip to content

Commit

Permalink
Optionally read IFA value and add it the the request url (Adhese) (#1563
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sander-adhese authored Nov 5, 2020
1 parent d044a93 commit aeeeba8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions adapters/adhese/adhese.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion adapters/adhese/adhesetest/exemplary/banner-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aeeeba8

Please sign in to comment.