Skip to content

GumGum adapter #833

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

Merged
merged 3 commits into from
Dec 6, 2016
Merged

GumGum adapter #833

merged 3 commits into from
Dec 6, 2016

Conversation

davidmh
Copy link
Contributor

@davidmh davidmh commented Nov 29, 2016

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other

Description of change

  • test parameters for validating bids
{
  bidder: 'gumgum',
  params: {
    inScreen: 'tracking_id'
  }
  // More products will be incorporated in the future.
}
  • contact email of the adapter’s maintainer
    [email protected]
  • official adapter submission

@kwunchoy
Copy link

kwunchoy commented Dec 5, 2016

@matthewlane sorry to bother you but can help us get our PR reviewed?

@matthewlane
Copy link
Collaborator

Yes, I'll review this today. Thanks for your patience

@matthewlane matthewlane self-assigned this Dec 5, 2016
Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

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

Thanks for this adapter PR. I was able to validate bids, just a few notes for your review below

}

beforeEach(() => {
pbjs._bidsRequested = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this line required for your tests? Overwriting the global data structures in tests can cause weird effects elsewhere. If this isn't needed please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need it. I was just trying to follow the convention used on other tests.

I'll remove it shortly.

const gumgumAdLoader = `r("${trackingId}",${productId},"${ encodedResponse }",window,top)`;
const gumgumLibrary = `(function(r){${gumgumAdLoader}})(function(trackingId,prodId,data,context,w,d,s,G){` +
'G=w.GUMGUM;d=w.document;function lg(){w.GUMGUM.pbjs(trackingId,prodId,data,context,this)}return!G?w' +
'.$$PREBID_GLOBAL$$.loadScript("https://g2.gumgum.com/javascripts/ggv2.js",lg):lg()});';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line 77 - 79 is hard for me to understand, can you clarify what's happening here? The rest of your code style looks great, if it's possible to apply that to this section and retain functionality, please do

Copy link
Contributor Author

@davidmh davidmh Dec 5, 2016

Choose a reason for hiding this comment

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

A lot of our creatives assume the GumGum script is running on top, so this function is intended to pass our winning bid to the entry point in our script (top.GUMGUGM.pbjs), but first, we need to be sure our script exists on top.

Here's the uncompressed script:

(function (request) {
    request( /* tracking id */ , /* productId */ , /* ad payload */ , /* iframed window */ , /* top window*/ );
})(function (trackingId, prodId, data, context, w, d, s, G) {
    G = w.GUMGUM;
    d = w.document;
    // load gumgum script
    function lg() {
        w.GUMGUM.pbjs(trackingId, prodId, data, context, this);
    }
    return !G
        // if the gumgum object doesn't exist on the top window, we need to load it
        // and then pass the payload
        ? w.$$PREBID_GLOBAL$$.loadScript("https://g2.gumgum.com/javascripts/ggv2.js", lg)
        // if the script is already running, just pass the payload
        : lg();
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthewlane do you need me to change the format?

Copy link
Member

Choose a reason for hiding this comment

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

@davidmh
Please include the unminified version in the adapter code. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@matthewlane matthewlane merged commit 05d0bf9 into prebid:master Dec 6, 2016
mp-12301 pushed a commit to aol/Prebid.js that referenced this pull request Apr 10, 2017
…ebid-official-0.16.0 to release/1.10.0

* commit 'fd16420d7034b1f82e571e2b122b7fa73b88d929':
  Add changelog entry.
  Add new adapters for AOL analytics.
  Updated Prebid version
  Catch cross-origin DOMException (prebid#861)
  Add GumGum adapter (prebid#833)
  Remove duplicate log line in request bids (prebid#859)
  Utility function getBidIdParamater is misspelled
  Allow Conversant sizes to be overridden per placement (prebid#816)
  Add districtmDMX adapter (prebid#811)
  Truncate bids requested on clearPlacements (prebid#825) (prebid#828)
  Update adapters.json (prebid#803)
  Add usersyncing to AppNexus adapters (prebid#845)
  fixes for bugs in test suite (prebid#810)
  Pass user object parameters on bid request (prebid#821)
  fix rubicon deals to be per ad instead of per response (prebid#838)
  Links bidId in request with adId in response for analytics purposes (prebid#836)
  Bugfix/issue building from npm (prebid#823)
  Update build to only run `webpack` to improve build time performance (prebid#809)
  Cast all Conversant site_ids to a string (prebid#829)
  Increment pre version
mp-12301 pushed a commit to aol/Prebid.js that referenced this pull request Apr 10, 2017
…10.0 to master

* commit 'b39f2b12a8ddfa650a8e04e3abd358e60371950a':
  Add changelog entry.
  Add new adapters for AOL analytics.
  Updated Prebid version
  Catch cross-origin DOMException (prebid#861)
  Add GumGum adapter (prebid#833)
  Remove duplicate log line in request bids (prebid#859)
  Utility function getBidIdParamater is misspelled
  Allow Conversant sizes to be overridden per placement (prebid#816)
  Add districtmDMX adapter (prebid#811)
  Truncate bids requested on clearPlacements (prebid#825) (prebid#828)
  Update adapters.json (prebid#803)
  Add usersyncing to AppNexus adapters (prebid#845)
  fixes for bugs in test suite (prebid#810)
  Pass user object parameters on bid request (prebid#821)
  fix rubicon deals to be per ad instead of per response (prebid#838)
  Links bidId in request with adId in response for analytics purposes (prebid#836)
  Bugfix/issue building from npm (prebid#823)
  Update build to only run `webpack` to improve build time performance (prebid#809)
  Cast all Conversant site_ids to a string (prebid#829)
  Increment pre version
@davidmh davidmh deleted the gumgum-adapter branch May 23, 2017 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants