From 6058d1e25e0cf7de4c0efb592b6aeeb31f6d1af3 Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Thu, 12 Mar 2026 15:52:26 +0200 Subject: [PATCH 1/3] updated burl AUCTION_PRICE macro resolving --- adapters/taboola/taboola.go | 1 + .../taboola/taboolatest/exemplary/bannerResolveMacro.json | 6 ++++-- .../taboola/taboolatest/exemplary/nativeResolveMacro.json | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/adapters/taboola/taboola.go b/adapters/taboola/taboola.go index ec65a4b6777..0e277ada2d4 100644 --- a/adapters/taboola/taboola.go +++ b/adapters/taboola/taboola.go @@ -303,5 +303,6 @@ func resolveMacros(bid *openrtb2.Bid) { price := strconv.FormatFloat(bid.Price, 'f', -1, 64) bid.NURL = strings.Replace(bid.NURL, "${AUCTION_PRICE}", price, -1) bid.AdM = strings.Replace(bid.AdM, "${AUCTION_PRICE}", price, -1) + bid.BURL = strings.Replace(bid.BURL, "${AUCTION_PRICE}", price, -1) } } diff --git a/adapters/taboola/taboolatest/exemplary/bannerResolveMacro.json b/adapters/taboola/taboolatest/exemplary/bannerResolveMacro.json index b673096c0b5..f2bf2574c6c 100644 --- a/adapters/taboola/taboolatest/exemplary/bannerResolveMacro.json +++ b/adapters/taboola/taboolatest/exemplary/bannerResolveMacro.json @@ -114,7 +114,8 @@ "w": 300, "h": 250, "exp": 60, - "lurl": "https://lurl.domain.com/" + "lurl": "https://lurl.domain.com/", + "burl": "https://burl.domain.com/?wp=${AUCTION_PRICE}" } ], "seat": "1111" @@ -145,7 +146,8 @@ "w": 300, "h": 250, "exp": 60, - "lurl": "https://lurl.domain.com/" + "lurl": "https://lurl.domain.com/", + "burl": "https://burl.domain.com/?wp=2.1" }, "type": "banner" } diff --git a/adapters/taboola/taboolatest/exemplary/nativeResolveMacro.json b/adapters/taboola/taboolatest/exemplary/nativeResolveMacro.json index e30f123cc16..3a25b5688e8 100644 --- a/adapters/taboola/taboolatest/exemplary/nativeResolveMacro.json +++ b/adapters/taboola/taboolatest/exemplary/nativeResolveMacro.json @@ -86,7 +86,8 @@ "cid": "cid", "crid": "crid", "lurl": "https://lurl.domain.com/", - "nurl": "nurl.com&wp=${AUCTION_PRICE}" + "nurl": "nurl.com&wp=${AUCTION_PRICE}", + "burl": "https://burl.domain.com/?wp=${AUCTION_PRICE}" } ], "seat": "1111" @@ -116,7 +117,8 @@ "cid": "cid", "crid": "crid", "lurl": "https://lurl.domain.com/", - "nurl": "nurl.com&wp=2.1" + "nurl": "nurl.com&wp=2.1", + "burl": "https://burl.domain.com/?wp=2.1" }, "type": "native" } From 84f2ecdf771cc6da307eb451aa3036348064d523 Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Thu, 12 Mar 2026 16:56:40 +0200 Subject: [PATCH 2/3] fix request.Ext overwrite by page type --- adapters/taboola/taboola.go | 20 +- .../exemplary/withPageTypeAndPrebidExt.json | 176 ++++++++++++++++++ adapters/taboola/utils.go | 6 +- 3 files changed, 190 insertions(+), 12 deletions(-) create mode 100644 adapters/taboola/taboolatest/exemplary/withPageTypeAndPrebidExt.json diff --git a/adapters/taboola/taboola.go b/adapters/taboola/taboola.go index 0e277ada2d4..9fbf36ecf6d 100644 --- a/adapters/taboola/taboola.go +++ b/adapters/taboola/taboola.go @@ -239,7 +239,7 @@ func createTaboolaRequests(request *openrtb2.BidRequest) (taboolaRequests []*ope } if taboolaExt.PageType != "" { - requestExt, requestExtErr := makeRequestExt(taboolaExt.PageType) + requestExt, requestExtErr := makeRequestExt(taboolaExt.PageType, modifiedRequest.Ext) if requestExtErr == nil { modifiedRequest.Ext = requestExt } else { @@ -253,17 +253,23 @@ func createTaboolaRequests(request *openrtb2.BidRequest) (taboolaRequests []*ope return taboolaRequests, errs } -func makeRequestExt(pageType string) (json.RawMessage, error) { - requestExt := &RequestExt{ - PageType: pageType, +func makeRequestExt(pageType string, existingExt json.RawMessage) (json.RawMessage, error) { + var extMap map[string]interface{} + if len(existingExt) > 0 { + if err := jsonutil.Unmarshal(existingExt, &extMap); err != nil { + extMap = make(map[string]interface{}) + } + } else { + extMap = make(map[string]interface{}) } - requestExtJson, err := json.Marshal(requestExt) + extMap["pageType"] = pageType + + requestExtJson, err := json.Marshal(extMap) if err != nil { - return nil, fmt.Errorf("could not marshal %s, err: %s", requestExt, err) + return nil, fmt.Errorf("could not marshal request ext, err: %s", err) } return requestExtJson, nil - } func getMediaType(impID string, imps []openrtb2.Imp) (openrtb_ext.BidType, error) { diff --git a/adapters/taboola/taboolatest/exemplary/withPageTypeAndPrebidExt.json b/adapters/taboola/taboolatest/exemplary/withPageTypeAndPrebidExt.json new file mode 100644 index 00000000000..4c4856e0475 --- /dev/null +++ b/adapters/taboola/taboolatest/exemplary/withPageTypeAndPrebidExt.json @@ -0,0 +1,176 @@ +{ + "mockBidRequest": { + "id": "request-id", + "imp": [ + { + "id": "impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidder": { + "publisherId": "publisher-id", + "tagid": "tag-id", + "pageType": "article" + } + } + } + ], + "site": { + "domain": "http://domain.com", + "page": "http://page-domain.com" + }, + "device": { + "ua": "Mozilla/5.0", + "h": 300, + "w": 300 + }, + "ext": { + "prebid": { + "channel": { + "name": "web", + "version": "1.0" + }, + "integration": "pbjs", + "server": { + "externalurl": "https://pbs.example.com", + "gvlid": 42, + "datacenter": "us-east-1" + }, + "sdk": { + "renderers": [ + { + "name": "test-renderer", + "version": "1.0.0" + } + ] + } + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://display.whatever.com/12/publisher-id", + "body": { + "id": "request-id", + "imp": [ + { + "id": "impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "tagid": "tag-id", + "ext": { + "bidder": { + "publisherId": "publisher-id", + "tagid": "tag-id", + "pageType": "article" + } + } + } + ], + "site": { + "id": "publisher-id", + "name": "publisher-id", + "domain": "http://domain.com", + "page": "http://page-domain.com", + "publisher": { + "id": "publisher-id" + } + }, + "device": { + "ua": "Mozilla/5.0", + "h": 300, + "w": 300 + }, + "ext": { + "pageType": "article", + "prebid": { + "channel": { + "name": "web", + "version": "1.0" + }, + "integration": "pbjs", + "server": { + "externalurl": "https://pbs.example.com", + "gvlid": 42, + "datacenter": "us-east-1" + }, + "sdk": { + "renderers": [ + { + "name": "test-renderer", + "version": "1.0.0" + } + ] + } + } + } + }, + "impIDs": ["impression-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "123", + "seatbid": [ + { + "bid": [ + { + "id": "request-id", + "impid": "impression-id", + "price": 2.1, + "adid": "1", + "adm": "", + "adomain": ["adomain.com"], + "cid": "cid", + "crid": "crid", + "w": 300, + "h": 250, + "exp": 60 + } + ], + "seat": "1111" + } + ], + "bidid": "123", + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "request-id", + "impid": "impression-id", + "price": 2.1, + "adid": "1", + "adm": "", + "adomain": ["adomain.com"], + "cid": "cid", + "crid": "crid", + "w": 300, + "h": 250, + "exp": 60 + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/taboola/utils.go b/adapters/taboola/utils.go index 2703ec69ad4..7c003daa78a 100644 --- a/adapters/taboola/utils.go +++ b/adapters/taboola/utils.go @@ -1,5 +1 @@ -package taboola - -type RequestExt struct { - PageType string `json:"pageType,omitempty"` -} +package taboola \ No newline at end of file From e8f8d0f193e226de0fa37a1277d3a66506ecf82a Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Thu, 12 Mar 2026 17:10:29 +0200 Subject: [PATCH 3/3] update utils.go --- adapters/taboola/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/taboola/utils.go b/adapters/taboola/utils.go index 7c003daa78a..d0c0a629a8d 100644 --- a/adapters/taboola/utils.go +++ b/adapters/taboola/utils.go @@ -1 +1 @@ -package taboola \ No newline at end of file +package taboola