From 1ee9957240b39951f12e2a55711a0e0557391e33 Mon Sep 17 00:00:00 2001 From: prebidtappx <77485538+prebidtappx@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:51:59 +0100 Subject: [PATCH] Tappx User Syncer + Site Update (#1674) Co-authored-by: ubuntu Co-authored-by: Albert Grandes --- adapters/tappx/tappx_test.go | 6 +- .../exemplary/single-banner-impression.json | 10 +- .../exemplary/single-banner-site.json | 124 ++++++++++++++++ .../exemplary/single-video-impression.json | 10 +- .../exemplary/single-video-site.json | 136 ++++++++++++++++++ .../tappx/tappxtest/params/race/banner.json | 4 +- .../tappx/tappxtest/params/race/video.json | 4 +- .../tappxtest/supplemental/204status.json | 10 +- .../banner-impression-badhost.json | 4 +- .../banner-impression-noendpoint.json | 2 +- .../banner-impression-nohost.json | 2 +- .../supplemental/banner-impression-nokey.json | 4 +- .../tappxtest/supplemental/bidfloor.json | 10 +- .../supplemental/http-err-status.json | 10 +- .../supplemental/http-err-status2.json | 10 +- .../supplemental/wrong-imp-ext-1.json | 4 +- adapters/tappx/usersync.go | 12 ++ adapters/tappx/usersync_test.go | 35 +++++ config/config.go | 4 +- static/bidder-info/tappx.yaml | 4 + usersync/usersyncers/syncer.go | 2 + usersync/usersyncers/syncer_test.go | 2 +- 22 files changed, 361 insertions(+), 48 deletions(-) create mode 100644 adapters/tappx/tappxtest/exemplary/single-banner-site.json create mode 100644 adapters/tappx/tappxtest/exemplary/single-video-site.json create mode 100644 adapters/tappx/usersync.go create mode 100644 adapters/tappx/usersync_test.go mode change 100755 => 100644 config/config.go mode change 100755 => 100644 usersync/usersyncers/syncer.go diff --git a/adapters/tappx/tappx_test.go b/adapters/tappx/tappx_test.go index 5346b82b694..187190862ea 100644 --- a/adapters/tappx/tappx_test.go +++ b/adapters/tappx/tappx_test.go @@ -12,7 +12,7 @@ import ( func TestJsonSamples(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderTappx, config.Adapter{ - Endpoint: "https://{{.Host}}"}) + Endpoint: "http://{{.Host}}"}) if buildErr != nil { t.Fatalf("Builder returned unexpected error %v", buildErr) @@ -30,7 +30,7 @@ func TestEndpointTemplateMalformed(t *testing.T) { func TestTsValue(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderTappx, config.Adapter{ - Endpoint: "https://{{.Host}}"}) + Endpoint: "http://{{.Host}}"}) if buildErr != nil { t.Fatalf("Builder returned unexpected error %v", buildErr) @@ -47,7 +47,7 @@ func TestTsValue(t *testing.T) { url, err := bidderTappx.buildEndpointURL(&tappxExt, test) - match, err := regexp.MatchString(`https://example\.host\.tappx\.com/DUMMYENDPOINT\?tappxkey=dummy-tappx-key&ts=[0-9]{13}&type_cnn=prebid&v=1\.1`, url) + match, err := regexp.MatchString(`http://example\.host\.tappx\.com/DUMMYENDPOINT\?tappxkey=dummy-tappx-key&ts=[0-9]{13}&type_cnn=prebid&v=1\.1`, url) if err != nil { t.Errorf("Error while running regex validation: %s", err.Error()) return diff --git a/adapters/tappx/tappxtest/exemplary/single-banner-impression.json b/adapters/tappx/tappxtest/exemplary/single-banner-impression.json index 3a365db645e..4f5b792fe4f 100644 --- a/adapters/tappx/tappxtest/exemplary/single-banner-impression.json +++ b/adapters/tappx/tappxtest/exemplary/single-banner-impression.json @@ -12,8 +12,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } @@ -33,7 +33,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -47,8 +47,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/exemplary/single-banner-site.json b/adapters/tappx/tappxtest/exemplary/single-banner-site.json new file mode 100644 index 00000000000..ef61b0e2567 --- /dev/null +++ b/adapters/tappx/tappxtest/exemplary/single-banner-site.json @@ -0,0 +1,124 @@ +{ + "mockBidRequest": { + "id": "0000000000001", + "test": 1, + "imp": [ + { + "id": "adunit-1", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "tappxkey": "pub-12345-site-9876", + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" + } + } + } + ], + "site": { + "id": "102855", + "cat": [ "IAB3-1" ], + "domain": "www.tappx.com", + "page": "https://www.tappx.com/example.html ", + "publisher": { + "id": "8953", "name": "publisher.com", + "cat": [ "IAB3-1" ], + "domain": "publisher.com" + } + }, + "user": { + "buyeruid": "A-38327932832" + } + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-site-9876&type_cnn=prebid&v=1.1", + "body": { + "id": "0000000000001", + "test": 1, + "imp": [ + { + "id": "adunit-1", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "tappxkey": "pub-12345-site-9876", + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" + } + } + } + ], + "site": { + "id": "102855", + "cat": [ "IAB3-1" ], + "domain": "www.tappx.com", + "page": "https://www.tappx.com/example.html ", + "publisher": { + "id": "8953", "name": "publisher.com", + "cat": [ "IAB3-1" ], + "domain": "publisher.com" + } + }, + "user": { + "buyeruid": "A-38327932832" + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "75472df2-1cb3-4f8e-9a28-10cb95fe05a4", + "seatbid": [{ + "bid": [{ + "id": "wehM-93KGr0_0_0", + "impid": "adunit-1", + "price": 0.5, + "cid": "3706", + "crid": "19005", + "adid": "19005", + "adm": "", + "cat": ["IAB2"], + "adomain": ["test.com"], + "h": 250, + "w": 300 + }] + }], + "bidid": "wehM-93KGr0" + } + } + } + ], + + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "wehM-93KGr0_0_0", + "impid": "adunit-1", + "price": 0.5, + "adm": "", + "adid": "19005", + "adomain": ["test.com"], + "cid": "3706", + "crid": "19005", + "w": 300, + "h": 250, + "cat": ["IAB2"] + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/tappx/tappxtest/exemplary/single-video-impression.json b/adapters/tappx/tappxtest/exemplary/single-video-impression.json index 49cb3c7e568..7a469b07fb6 100644 --- a/adapters/tappx/tappxtest/exemplary/single-video-impression.json +++ b/adapters/tappx/tappxtest/exemplary/single-video-impression.json @@ -15,8 +15,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "VZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } @@ -35,7 +35,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/VZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -51,8 +51,8 @@ }, "ext": { "bidder": { - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com", + "endpoint": "VZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/", "tappxkey": "pub-12345-android-9876" } } diff --git a/adapters/tappx/tappxtest/exemplary/single-video-site.json b/adapters/tappx/tappxtest/exemplary/single-video-site.json new file mode 100644 index 00000000000..9ee2f8f4187 --- /dev/null +++ b/adapters/tappx/tappxtest/exemplary/single-video-site.json @@ -0,0 +1,136 @@ +{ + "mockBidRequest": { + "id": "0000000000001", + "test": 1, + "imp": [ + { + "id": "video-adunit-2", + "video": { + "mimes": [ + "video/mp4" + ], + "w": 640, + "h": 480 + }, + "ext": { + "bidder": { + "tappxkey": "pub-12345-site-9876", + "endpoint": "VZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" + } + } + } + ], + "site": { + "id": "102855", + "cat": [ "IAB3-1" ], + "domain": "www.tappx.com", + "page": "https://www.tappx.com/example.html ", + "publisher": { + "id": "8953", "name": "publisher.com", + "cat": [ "IAB3-1" ], + "domain": "publisher.com" + } + }, + "user": { + "buyeruid": "A-38327932832" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://testing.ssp.tappx.com/rtb/v2/VZ123456PS?tappxkey=pub-12345-site-9876&type_cnn=prebid&v=1.1", + "body": { + "id": "0000000000001", + "test": 1, + "imp": [ + { + "id": "video-adunit-2", + "video": { + "mimes": [ + "video/mp4" + ], + "w": 640, + "h": 480 + }, + "ext": { + "bidder": { + "endpoint": "VZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/", + "tappxkey": "pub-12345-site-9876" + } + } + } + ], + "site": { + "id": "102855", + "cat": [ "IAB3-1" ], + "domain": "www.tappx.com", + "page": "https://www.tappx.com/example.html ", + "publisher": { + "id": "8953", "name": "publisher.com", + "cat": [ "IAB3-1" ], + "domain": "publisher.com" + } + }, + "user": { + "buyeruid": "A-38327932832" + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "75472df2-1cb3-4f8e-9a28-10cb95fe05a4", + "seatbid": [ + { + "bid": [ + { + "id": "bid02", + "impid": "video-adunit-2", + "price": 2.25, + "cid": "1001", + "crid": "2002", + "adid": "2002", + "adm": "", + "cat": [ + "IAB2" + ], + "adomain": [ + "video-example.com" + ] + } + ] + } + ], + "bidid": "wehM-93KGr0" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "bid02", + "impid": "video-adunit-2", + "price": 2.25, + "adm": "", + "adomain": [ + "video-example.com" + ], + "cid": "1001", + "adid": "2002", + "crid": "2002", + "cat": [ + "IAB2" + ] + }, + "type": "video" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/tappx/tappxtest/params/race/banner.json b/adapters/tappx/tappxtest/params/race/banner.json index 4c2ec640ff5..9264443a5ca 100644 --- a/adapters/tappx/tappxtest/params/race/banner.json +++ b/adapters/tappx/tappxtest/params/race/banner.json @@ -1,5 +1,5 @@ { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } \ No newline at end of file diff --git a/adapters/tappx/tappxtest/params/race/video.json b/adapters/tappx/tappxtest/params/race/video.json index 4c2ec640ff5..438543f2362 100644 --- a/adapters/tappx/tappxtest/params/race/video.json +++ b/adapters/tappx/tappxtest/params/race/video.json @@ -1,5 +1,5 @@ { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "VZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } \ No newline at end of file diff --git a/adapters/tappx/tappxtest/supplemental/204status.json b/adapters/tappx/tappxtest/supplemental/204status.json index 288837b7b91..6172da59cbd 100644 --- a/adapters/tappx/tappxtest/supplemental/204status.json +++ b/adapters/tappx/tappxtest/supplemental/204status.json @@ -12,8 +12,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } @@ -30,7 +30,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -44,8 +44,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/supplemental/banner-impression-badhost.json b/adapters/tappx/tappxtest/supplemental/banner-impression-badhost.json index c82d0e852f3..12f9c54ae02 100644 --- a/adapters/tappx/tappxtest/supplemental/banner-impression-badhost.json +++ b/adapters/tappx/tappxtest/supplemental/banner-impression-badhost.json @@ -11,7 +11,7 @@ "ext": { "bidder": { "host": "example.ho%st.tappx.com", - "endpoint": "PREBIDTEMPLATE", + "endpoint": "ZZ123456PS", "tappxkey": "pub-12345-android-9876" } } @@ -31,7 +31,7 @@ "expectedMakeRequestsErrors": [ { - "value": "Malformed URL: parse (\\\")?https://example\\.ho%st\\.tappx.com(\\\")?: invalid URL escape \\\"%st\\\"", + "value": "Malformed URL: parse (\\\")?http://example\\.ho%st\\.tappx.com(\\\")?: invalid URL escape \\\"%st\\\"", "comparison": "regex" } ] diff --git a/adapters/tappx/tappxtest/supplemental/banner-impression-noendpoint.json b/adapters/tappx/tappxtest/supplemental/banner-impression-noendpoint.json index 9a49c8b05a0..85370b4b07c 100644 --- a/adapters/tappx/tappxtest/supplemental/banner-impression-noendpoint.json +++ b/adapters/tappx/tappxtest/supplemental/banner-impression-noendpoint.json @@ -11,7 +11,7 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "host": "test.tappx.com" + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/supplemental/banner-impression-nohost.json b/adapters/tappx/tappxtest/supplemental/banner-impression-nohost.json index ffe0f14f949..df650dde39a 100644 --- a/adapters/tappx/tappxtest/supplemental/banner-impression-nohost.json +++ b/adapters/tappx/tappxtest/supplemental/banner-impression-nohost.json @@ -10,7 +10,7 @@ }, "ext": { "bidder": { - "endpoint": "PREBIDTEMPLATE", + "endpoint": "ZZ123456PS", "tappxkey": "pub-12345-android-9876" } } diff --git a/adapters/tappx/tappxtest/supplemental/banner-impression-nokey.json b/adapters/tappx/tappxtest/supplemental/banner-impression-nokey.json index 2bc147ec07f..4dba6d3b366 100644 --- a/adapters/tappx/tappxtest/supplemental/banner-impression-nokey.json +++ b/adapters/tappx/tappxtest/supplemental/banner-impression-nokey.json @@ -10,8 +10,8 @@ }, "ext": { "bidder": { - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/supplemental/bidfloor.json b/adapters/tappx/tappxtest/supplemental/bidfloor.json index 61e96a442a0..48c1b0fbfa7 100644 --- a/adapters/tappx/tappxtest/supplemental/bidfloor.json +++ b/adapters/tappx/tappxtest/supplemental/bidfloor.json @@ -12,8 +12,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com", + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/", "bidfloor": 1.5 } } @@ -34,7 +34,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -49,8 +49,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com", + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/", "bidfloor": 1.5 } } diff --git a/adapters/tappx/tappxtest/supplemental/http-err-status.json b/adapters/tappx/tappxtest/supplemental/http-err-status.json index c2db2e1eea8..045695046ff 100644 --- a/adapters/tappx/tappxtest/supplemental/http-err-status.json +++ b/adapters/tappx/tappxtest/supplemental/http-err-status.json @@ -12,8 +12,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } @@ -30,7 +30,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -44,8 +44,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/supplemental/http-err-status2.json b/adapters/tappx/tappxtest/supplemental/http-err-status2.json index b09ee26b68e..0cb5fd4a400 100644 --- a/adapters/tappx/tappxtest/supplemental/http-err-status2.json +++ b/adapters/tappx/tappxtest/supplemental/http-err-status2.json @@ -12,8 +12,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } @@ -30,7 +30,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", + "uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1", "body": { "id": "0000000000001", "test": 1, @@ -44,8 +44,8 @@ "ext": { "bidder": { "tappxkey": "pub-12345-android-9876", - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/tappxtest/supplemental/wrong-imp-ext-1.json b/adapters/tappx/tappxtest/supplemental/wrong-imp-ext-1.json index 1cbd3eefda1..1404204eaf1 100644 --- a/adapters/tappx/tappxtest/supplemental/wrong-imp-ext-1.json +++ b/adapters/tappx/tappxtest/supplemental/wrong-imp-ext-1.json @@ -11,8 +11,8 @@ "ext": { "bidder": { "tappxkey": 1, - "endpoint": "PREBIDTEMPLATE", - "host": "test.tappx.com" + "endpoint": "ZZ123456PS", + "host": "testing.ssp.tappx.com/rtb/v2/" } } } diff --git a/adapters/tappx/usersync.go b/adapters/tappx/usersync.go new file mode 100644 index 00000000000..7bf6b9a6094 --- /dev/null +++ b/adapters/tappx/usersync.go @@ -0,0 +1,12 @@ +package tappx + +import ( + "text/template" + + "github.com/prebid/prebid-server/adapters" + "github.com/prebid/prebid-server/usersync" +) + +func NewTappxSyncer(temp *template.Template) usersync.Usersyncer { + return adapters.NewSyncer("tappx", 628, temp, adapters.SyncTypeIframe) +} diff --git a/adapters/tappx/usersync_test.go b/adapters/tappx/usersync_test.go new file mode 100644 index 00000000000..65919b9f1f1 --- /dev/null +++ b/adapters/tappx/usersync_test.go @@ -0,0 +1,35 @@ +package tappx + +import ( + "testing" + "text/template" + + "github.com/prebid/prebid-server/privacy" + "github.com/prebid/prebid-server/privacy/ccpa" + "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/stretchr/testify/assert" +) + +func TestTappxSyncer(t *testing.T) { + syncURL := "//testing.ssp.tappx.com/cs/usersync.php?gdpr_optin={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&type=iframe&ruid=localhost%2Fsetuid%3Fbidder%3Dtappx%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7B%7BTPPXUID%7D%7D" + syncURLTemplate := template.Must( + template.New("sync-template").Parse(syncURL), + ) + + syncer := NewTappxSyncer(syncURLTemplate) + syncInfo, err := syncer.GetUsersyncInfo(privacy.Policies{ + GDPR: gdpr.Policy{ + Signal: "1", + Consent: "A", + }, + CCPA: ccpa.Policy{ + Consent: "1YNN", + }, + }) + + assert.NoError(t, err) + assert.Equal(t, "//testing.ssp.tappx.com/cs/usersync.php?gdpr_optin=1&gdpr_consent=A&us_privacy=1YNN&type=iframe&ruid=localhost%2Fsetuid%3Fbidder%3Dtappx%26gdpr%3D1%26gdpr_consent%3DA%26uid%3D%7B%7BTPPXUID%7D%7D", syncInfo.URL) + assert.Equal(t, "iframe", syncInfo.Type) + assert.EqualValues(t, 628, syncer.GDPRVendorID()) + assert.Equal(t, false, syncInfo.SupportCORS) +} diff --git a/config/config.go b/config/config.go old mode 100755 new mode 100644 index ae1f62e90b4..755c8fc95c8 --- a/config/config.go +++ b/config/config.go @@ -629,7 +629,7 @@ func (cfg *Configuration) setDerivedDefaults() { setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderSonobi, "https://sync.go.sonobi.com/us.gif?loc="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dsonobi%26consent_string%3D{{.GDPR}}%26gdpr%3D{{.GDPRConsent}}%26uid%3D%5BUID%5D") setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderSovrn, "https://ap.lijit.com/pixel?redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dsovrn%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID") setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderSynacormedia, "https://sync.technoratimedia.com/services?srv=cs&pid=70&cb="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dsynacormedia%26uid%3D%5BUSER_ID%5D") - // openrtb_ext.BidderTappx doesn't have a good default. + setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderTappx, "https://ssp.api.tappx.com/cs/usersync.php?gdpr_optin={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&type=iframe&ruid="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dtappx%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7B%7BTPPXUID%7D%7D") setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderTelaria, "https://pbs.publishers.tremorhub.com/pubsync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dtelaria%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%5Btvid%5D") setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderTriplelift, "https://eb2.3lift.com/getuid?gdpr={{.GDPR}}&cmp_cs={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dtriplelift%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID") setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderTripleliftNative, "https://eb2.3lift.com/getuid?gdpr={{.GDPR}}&cmp_cs={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dtriplelift_native%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID") @@ -879,7 +879,7 @@ func SetupViper(v *viper.Viper, filename string) { v.SetDefault("adapters.sonobi.endpoint", "https://apex.go.sonobi.com/prebid?partnerid=71d9d3d8af") v.SetDefault("adapters.sovrn.endpoint", "http://ap.lijit.com/rtb/bid?src=prebid_server") v.SetDefault("adapters.synacormedia.endpoint", "http://{{.Host}}.technoratimedia.com/openrtb/bids/{{.Host}}") - v.SetDefault("adapters.tappx.endpoint", "https://{{.Host}}") + v.SetDefault("adapters.tappx.endpoint", "http://{{.Host}}") v.SetDefault("adapters.telaria.endpoint", "https://ads.tremorhub.com/ad/rtb/prebid") v.SetDefault("adapters.triplelift_native.disabled", true) v.SetDefault("adapters.triplelift_native.extra_info", "{\"publisher_whitelist\":[]}") diff --git a/static/bidder-info/tappx.yaml b/static/bidder-info/tappx.yaml index 4c8d1560f27..527959b75d1 100644 --- a/static/bidder-info/tappx.yaml +++ b/static/bidder-info/tappx.yaml @@ -5,3 +5,7 @@ capabilities: mediaTypes: - banner - video + site: + mediaTypes: + - banner + - video \ No newline at end of file diff --git a/usersync/usersyncers/syncer.go b/usersync/usersyncers/syncer.go old mode 100755 new mode 100644 index c41f7c6c746..25b37fa388c --- a/usersync/usersyncers/syncer.go +++ b/usersync/usersyncers/syncer.go @@ -69,6 +69,7 @@ import ( "github.com/prebid/prebid-server/adapters/sonobi" "github.com/prebid/prebid-server/adapters/sovrn" "github.com/prebid/prebid-server/adapters/synacormedia" + "github.com/prebid/prebid-server/adapters/tappx" "github.com/prebid/prebid-server/adapters/telaria" "github.com/prebid/prebid-server/adapters/triplelift" "github.com/prebid/prebid-server/adapters/triplelift_native" @@ -156,6 +157,7 @@ func NewSyncerMap(cfg *config.Configuration) map[openrtb_ext.BidderName]usersync insertIntoMap(cfg, syncers, openrtb_ext.BidderSmartRTB, smartrtb.NewSmartRTBSyncer) insertIntoMap(cfg, syncers, openrtb_ext.BidderSmartyAds, smartyads.NewSmartyAdsSyncer) insertIntoMap(cfg, syncers, openrtb_ext.BidderSynacormedia, synacormedia.NewSynacorMediaSyncer) + insertIntoMap(cfg, syncers, openrtb_ext.BidderTappx, tappx.NewTappxSyncer) insertIntoMap(cfg, syncers, openrtb_ext.BidderTelaria, telaria.NewTelariaSyncer) insertIntoMap(cfg, syncers, openrtb_ext.BidderTriplelift, triplelift.NewTripleliftSyncer) insertIntoMap(cfg, syncers, openrtb_ext.BidderTripleliftNative, triplelift_native.NewTripleliftSyncer) diff --git a/usersync/usersyncers/syncer_test.go b/usersync/usersyncers/syncer_test.go index 73f0e8861c5..818303b8e53 100755 --- a/usersync/usersyncers/syncer_test.go +++ b/usersync/usersyncers/syncer_test.go @@ -78,6 +78,7 @@ func TestNewSyncerMap(t *testing.T) { string(openrtb_ext.BidderSonobi): syncConfig, string(openrtb_ext.BidderSovrn): syncConfig, string(openrtb_ext.BidderSynacormedia): syncConfig, + string(openrtb_ext.BidderTappx): syncConfig, string(openrtb_ext.BidderTelaria): syncConfig, string(openrtb_ext.BidderTriplelift): syncConfig, string(openrtb_ext.BidderTripleliftNative): syncConfig, @@ -112,7 +113,6 @@ func TestNewSyncerMap(t *testing.T) { openrtb_ext.BidderRevcontent: true, openrtb_ext.BidderSilverMob: true, openrtb_ext.BidderSmaato: true, - openrtb_ext.BidderTappx: true, openrtb_ext.BidderYeahmobi: true, }