-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
GumGum adapter #833
Conversation
Tests
@matthewlane sorry to bother you but can help us get our PR reviewed? |
Yes, I'll review this today. Thanks for your patience |
There was a problem hiding this 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 = []; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()});'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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();
});
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…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
…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
Type of change
Description of change
[email protected]