From f5592fbee5989ec93cf89f83e29e4ffdf244b0f0 Mon Sep 17 00:00:00 2001 From: Neale Upstone Date: Mon, 28 Jan 2019 19:33:40 +0000 Subject: [PATCH] Remove additional markup from ad markup - just pass Content.Body through --- adapters/consumable/consumable.go | 3 +- .../consumable/exemplary/simple-banner.json | 2 +- .../simple-banner-no-impressionUrl.json | 2 +- adapters/consumable/retrieveAd.go | 29 ++----------------- 4 files changed, 6 insertions(+), 30 deletions(-) diff --git a/adapters/consumable/consumable.go b/adapters/consumable/consumable.go index 613470f9795..21f2c244d86 100644 --- a/adapters/consumable/consumable.go +++ b/adapters/consumable/consumable.go @@ -218,13 +218,12 @@ func (a *ConsumableAdapter) MakeBids( } if decision.Pricing != nil && decision.Pricing.ClearPrice != nil { - _, consumableExt, _ := extractExtensions(*imp) bid := openrtb.Bid{} bid.ID = internalRequest.ID bid.ImpID = impID bid.Price = *decision.Pricing.ClearPrice - bid.AdM = retrieveAd(decision, consumableExt.UnitId, consumableExt.UnitName, a.clock.Now()) + bid.AdM = retrieveAd(decision) bid.W = imp.Banner.Format[0].W // TODO: Review to check if this is correct behaviour bid.H = imp.Banner.Format[0].H bid.CrID = strconv.FormatInt(decision.AdID, 10) diff --git a/adapters/consumable/consumable/exemplary/simple-banner.json b/adapters/consumable/consumable/exemplary/simple-banner.json index 8fb9da85cb8..ae57a9f13f6 100644 --- a/adapters/consumable/consumable/exemplary/simple-banner.json +++ b/adapters/consumable/consumable/exemplary/simple-banner.json @@ -105,7 +105,7 @@ "id": "test-request-id", "impid": "test-imp-id", "price": 0.5, - "adm": "Remember this: https://www.google.com/search?q=blink+tag ?
", + "adm": "Remember this: https://www.google.com/search?q=blink+tag ?", "crid": "1234567890", "exp": 30, "w": 728, diff --git a/adapters/consumable/consumable/supplemental/simple-banner-no-impressionUrl.json b/adapters/consumable/consumable/supplemental/simple-banner-no-impressionUrl.json index c5b2857c3b4..66f18d548b5 100644 --- a/adapters/consumable/consumable/supplemental/simple-banner-no-impressionUrl.json +++ b/adapters/consumable/consumable/supplemental/simple-banner-no-impressionUrl.json @@ -119,7 +119,7 @@ "crid": "1234567890", "impid": "test-no-impUrl-id", "price": 0.5, - "adm": "Remember this: https://www.google.com/search?q=blink+tag ?", + "adm": "Remember this: https://www.google.com/search?q=blink+tag ?", "exp": 30, "w": 300, "h": 250 diff --git a/adapters/consumable/retrieveAd.go b/adapters/consumable/retrieveAd.go index 3539ce66a68..7f69a1bbc23 100644 --- a/adapters/consumable/retrieveAd.go +++ b/adapters/consumable/retrieveAd.go @@ -1,33 +1,10 @@ package consumable -import ( - "strconv" - "time" -) +func retrieveAd(decision decision) string { -func retrieveAd(decision decision, unitId int, unitName string, now time.Time) string { - - oad := "" if decision.Contents != nil && len(decision.Contents) > 0 { - // When testing against e.serverbid.com, Contents seems to have a fair bit of usersync code both as img and iframe - oad = decision.Contents[0].Body + createTrackPixelHtml(decision.ImpressionUrl) + return decision.Contents[0].Body } - cb := strconv.FormatInt(now.Unix(), 10) - sUnitId := strconv.Itoa(unitId) - - // Some observed systems omit unitName and still get bids, so we'll make sure we attempt something in that case - // we can remove this later if needed. Note: This is an addition compared to prebid.js implementation - if len(unitName) == 0 { - unitName = "fakeName" + sUnitId - } - - ad := "" + oad + - "" + - "" + - "" - - return ad + return "" }