Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally read IFA value and add it the the request url (Adhese) #1563

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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