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

GumGum Adapter for Prebid.js 1.0 #1966

Merged
merged 4 commits into from
Jan 18, 2018
Merged

Conversation

mxcoder
Copy link
Contributor

@mxcoder mxcoder commented Dec 15, 2017

Type of change

  • New bidder adapter

Description of change

GumGum Adapter according to 1.0 rules

  • test parameters for validating bids
{
  bidder: 'gumgum',
  params: {
    inSlot: '9'
  }
}
  • contact email of the adapter’s maintainer
    ricardo@gumgum.com

  • official adapter submission

Other information

We already had a GumGum Adapter integrated, this is just to upgrade to 1.0
CC @bruscantini

@mxcoder
Copy link
Contributor Author

mxcoder commented Dec 21, 2017

Hi @matthewlane and prebid team members, just wondering if you have any info on the time window in which we could see these reviewed/merged? We know holidays are here, but just to manage expectations on our end.

Thanks

@matthewlane
Copy link
Collaborator

Hi @mxcoder, many of us are out until the new year, and we plan to ramp back up with full PR reviews and other work in January. Thank you for your pull request and for your patience

@mxcoder
Copy link
Contributor Author

mxcoder commented Dec 21, 2017

Excellent, thanks a lot @matthewlane . Have a great holiday season.

@mike-chowla
Copy link
Contributor

With provided test params, no ad displays.

The issue is due to the price coming back as zero. Even though the zero bid wins the prebid auction, DFP is not selecting the ad. If I hack the price higher, the ad renders.

Request:
https://g2.gumgum.com/hbid/imp?si=9&pi=3&vw=1479&vh=272&sw=1920&sh=1080&pu=http%3A%2F%2Fmike.pubmatic.com%3A9999%2FintegrationExamples%2Fgpt%2Fhello_world.html%3Fpbjs_debug%3Dtrue&ce=true&dpr=1&

Response:
{"ad":{"id":29593,"width":300,"height":250,"ipd":2000,"markup":"<div style=\"width:298px;height:248px;background:#fff;display:block;border:1px solid #000;background:#fff url(https://c.gumgum.com/images/logo/all300.png) no-repeat scroll center center\">\n<\/div>","ii":true,"du":null,"price":0,"zi":0,"impurl":"http://ca-g2.gumgum.com/ad/view/enc/hasR4Y3aDoKInNYRxCfOp-Uatqav0e1WD5G7kBz28TPH_FI449l6geYihxmDbqkBwToLOroJBD8SkTOO_3-HoDBFm10IWp16dPzbpg5B3of-PtAu3cxrjdK4-4tOgMEe51OJok4Wqa4wR9LJVmrMqtxqobqryL2-KCm4tbWGbmo8vMZCy-heOj3YHMv35pzSaq_n2CHze-VbuROJ9mnZwrb63DJ4tTxteW30RaP85-E?c=0","clsurl":"http://ca-g2.gumgum.com/ad/close?si=9&t=ggumtest&ab=29593&pv=&pu=http%3A%2F%2Fmike.pubmatic.com%3A9999%2FintegrationExamples%2Fgpt%2Fhello_world.html%3Fpbjs_debug%3Dtrue&lt=&to=&ts=1515023714357&er=0E-10"},"pag":{"t":"ggumtest","css":"#GGID ._gBadge._g.Badge {\n z-index: 1000 !important;\n}\n\n/* DB-4066 */\nhtml { overflow-y: auto }","js":"G.infoFlag = 'japan';\n/* GG-18932 */\nG.samplerate = 100;\nG.loadObj('https://c.gumgum.com/libs/GG-18932.min.js',{type:'s',cb:false});\n/* AT-5020 */\nG.perfSampleRate = 100;\nconsole.log(\"environment\", env);"},"thms":10000,"cw":"<img src=\"https://c.gumgum.com/px.gif\" onload=\"(function(a,b){b.src='https://js.gumgum.com/gumgum.js',a.parentNode.replaceChild(b,a)})(this,document.createElement('script'))\"><gumgum-ad product=\"3\" fromAS='AD_JSON'><\/gumgum-ad>"}

@mike-chowla
Copy link
Contributor

User syncs are broken and causing 404s.

The user sync url is being set to a fixed string:
url: 'ADAPTER_SYNC_URL'

Which causes the browser to load 'ADAPTER_SYNC_URL' relative to the current path which 404s

@bruscantini
Copy link
Contributor

bruscantini commented Jan 4, 2018

Hi @mike-chowla . Thanks for the feedback. For the test params, what adjustments would you recommend? Do you think this would require non-zero price values to be returned by our ad server all the time? I guess what I'm asking is whether there can be anything done on the adapter side to "hack" the price value for the test unit, or if the change would have to be done on our server side.

@mike-chowla
Copy link
Contributor

The clean way to do this is to use a non-zero price coming back from the ad server.

@bruscantini
Copy link
Contributor

Thanks @mike-chowla . I opted to make the change in the adapter as doing so on the ad server was not as simple as I'd hoped.

@mike-chowla
Copy link
Contributor

mike-chowla commented Jan 9, 2018

Your isTestUnit check is failing because it expects the si field to be an integer but it's a string (at least when using the test parameters)

This fixes the check:

-  let isTestUnit = (bidRequest.data && bidRequest.data.pi === 3 && bidRequest.data.si === 9)
+  let isTestUnit = (bidRequest.data && bidRequest.data.pi === 3 && bidRequest.data.si === "9")

@bruscantini
Copy link
Contributor

Nice catch! Updated.

Copy link
Contributor

@mike-chowla mike-chowla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With changes, LGTM

Test failure is shown but it's unrelated to this code and tests pass on my machine.

// dealId: DEAL_ID,
// referrer: REFERER,
ad: wrapper ? getWrapperCode(wrapper, Object.assign({}, serverResponseBody, { bidRequest })) : markup,
bidderCode: spec.code,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bidderCode will be set automatically by bidderFactory now, this line can be dropped

cw: wrapper
} = serverResponseBody
let isTestUnit = (bidRequest.data && bidRequest.data.pi === 3 && bidRequest.data.si === 9)
let [width, height] = bidRequest.sizes[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ad unit sizes may be defined as a double array ([[300, 250]]) or single array ([300, 250]). This will break if the size is defined as a single array, but utils.parseSizesInput can help account for either case. Something like utils.parseSizesInput(bidRequest.sizes)[0].split('x') if you only want the first size in the list

…t.sizes to account for 1-dimensional array.
@bruscantini
Copy link
Contributor

thanks @matthewlane . Updated based on your suggestions.

@matthewlane matthewlane merged commit f09865b into prebid:master Jan 18, 2018
@matthewlane
Copy link
Collaborator

@mxcoder @bruscantini This is merged to master. Please also submit a PR to update your bidder file in the docs repo, to add the line prebid_1_0_supported : true to the header, and make any updates to the bidder params if necessary

Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this pull request Jan 23, 2018
* 'master' of https://github.com/prebid/Prebid.js: (23 commits)
  Update Atomx adapter for Prebid v1.0 (prebid#2026)
  Add vi bid adapter (prebid#2020)
  Add eplanningBidAdapter (prebid#2003)
  OpenX Adapter: Update to support mediaTypes field, instead of the deprecated mediaType field (prebid#1974)
  Separate bids & won calls (prebid#2015)
  1.0 adapter support for mantis (prebid#1840)
  Media.net adapter added (prebid#2038)
  GumGum Adapter for Prebid.js 1.0 (prebid#1966)
  Serverbid Bid Adapter: updated docs and ad sizes (prebid#2023)
  Adding districtm as an alias (prebid#2018)
  Use sudo to workaround Travis regression (prebid#2041)
  Fix uncached video bids triggering callback early (prebid#2017)
  Re-implemented RhythmOne audit beacon in prebid 1.0 interface (prebid#1953)
  Add NasmediaAdmixer adapter for Perbid.js 1.0 (prebid#1937)
  Update Adform adapter to Prebid v1.0 (prebid#1947)
  Upgrade Admixer adapter for Prebid 1.0 (prebid#1755)
  multiformat size validation checks (prebid#1964)
  Gjirafa Bidder Adapter (prebid#1944)
  pin gulp-connect at non-broken version (prebid#2008)
  Added dynamic ttl property for One Display and One Mobile. (prebid#2004)
  ...
ehoch pushed a commit to mediavine/Prebid.js that referenced this pull request Jan 29, 2018
* GumGum Adapter for Prebid.js 1.0

* removed getUserSyncs. Give cpm a non-zero value when bidRequest is for test unit so DFP chooses it.

* parsing slot ID as integer from params

* ADSS-78 removed bidderCode from response. Correctly parsing bidRequest.sizes to account for 1-dimensional array.
@rmloveland
Copy link
Contributor

Added the needs-docs label since it's not showing up on http://prebid.org/download.html in the 1.2.0 dropdown due to lack of the page having the "prebid 1.0 support" key in the page's YAML header.

@mxcoder
Copy link
Contributor Author

mxcoder commented Feb 1, 2018

Thanks, we're working on this. We'll send another PR.

dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* GumGum Adapter for Prebid.js 1.0

* removed getUserSyncs. Give cpm a non-zero value when bidRequest is for test unit so DFP chooses it.

* parsing slot ID as integer from params

* ADSS-78 removed bidderCode from response. Correctly parsing bidRequest.sizes to account for 1-dimensional array.
@lbenmore lbenmore deleted the ADSS-78-prebid-1.0 branch January 4, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants