diff --git a/adapters/taboola/taboola.go b/adapters/taboola/taboola.go index 9d950bef2cb..6621c78f6eb 100644 --- a/adapters/taboola/taboola.go +++ b/adapters/taboola/taboola.go @@ -131,7 +131,14 @@ func (a *adapter) buildRequest(request *openrtb2.BidRequest) (*adapters.RequestD return nil, fmt.Errorf("unsupported media type for imp: %v", request.Imp[0]) } - url, err := a.buildEndpointURL(request.Site.ID, mediaType) + var taboolaPublisherId string + if request.Site != nil && request.Site.ID != "" { + taboolaPublisherId = request.Site.ID + } else if request.App != nil && request.App.ID != "" { + taboolaPublisherId = request.App.ID + } + + url, err := a.buildEndpointURL(taboolaPublisherId, mediaType) if err != nil { return nil, err } @@ -207,22 +214,20 @@ func createTaboolaRequests(request *openrtb2.BidRequest) (taboolaRequests []*ope ID: taboolaExt.PublisherId, } - if modifiedRequest.Site == nil { - newSite := &openrtb2.Site{ - ID: taboolaExt.PublisherId, - Name: taboolaExt.PublisherId, - Domain: evaluateDomain(taboolaExt.PublisherDomain, request), - Publisher: publisher, - } - modifiedRequest.Site = newSite - } else { + if modifiedRequest.Site != nil { modifiedSite := *modifiedRequest.Site - modifiedSite.Publisher = publisher modifiedSite.ID = taboolaExt.PublisherId modifiedSite.Name = taboolaExt.PublisherId modifiedSite.Domain = evaluateDomain(taboolaExt.PublisherDomain, request) + modifiedSite.Publisher = publisher modifiedRequest.Site = &modifiedSite } + if modifiedRequest.App != nil { + modifiedApp := *modifiedRequest.App + modifiedApp.ID = taboolaExt.PublisherId + modifiedApp.Publisher = publisher + modifiedRequest.App = &modifiedApp + } if taboolaExt.BCat != nil { modifiedRequest.BCat = taboolaExt.BCat diff --git a/adapters/taboola/taboolatest/supplemental/emptySiteInRequest.json b/adapters/taboola/taboolatest/exemplary/bannerAppRequest.json similarity index 93% rename from adapters/taboola/taboolatest/supplemental/emptySiteInRequest.json rename to adapters/taboola/taboolatest/exemplary/bannerAppRequest.json index 3245290f756..34322399a00 100644 --- a/adapters/taboola/taboolatest/supplemental/emptySiteInRequest.json +++ b/adapters/taboola/taboolatest/exemplary/bannerAppRequest.json @@ -23,13 +23,14 @@ "ext": { "bidder": { "publisherId": "publisher-id", - "tagid": "tag-id" + "tagid": "tag-id", + "tagId": "tag-Id" } } } ], "app": { - "domain": "http://domain.com" + "bundle": "com.app.my" }, "device": { "ua": "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.62 Mobile Safari/537.36", @@ -62,21 +63,19 @@ } ] }, - "tagid" : "tag-id", + "tagid" : "tag-Id", "ext": { "bidder": { "publisherId": "publisher-id", - "tagid": "tag-id" + "tagid": "tag-id", + "tagId": "tag-Id" } } } ], "app": { - "domain": "http://domain.com" - }, - "site": { "id": "publisher-id", - "name": "publisher-id", + "bundle": "com.app.my", "publisher": { "id": "publisher-id" }