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

Optimera Adapter for 1.0 (#1759) #1760

Closed
wants to merge 5 commits into from
Closed

Conversation

mcallari
Copy link
Contributor

@mcallari mcallari commented Oct 24, 2017

Type of change

  • New bidder adapter

Type of issue

Feature Request

Description

Adding Optimera's bid adapter for public use. Optimera's technology allows publishers to target viewability data to automate viewability optimization for any line item or PMP. Optimera does not push bids but instead targeting data via the deal ID space.

test parameters for validating bids

  • Optimera will pass targeting data via hb_deal_optimera, will never pass a size therefore 0x0, will never pass a price therefore 0.00. For example:
    hb_deal_optimera=RB_K,300x250K,300x600K&hb_size_optimera=0x0&hb_pb_optimera=0.00&hb_adid_optimera=86a7b6905fe174&hb_bidder_optimera=optimera
{
  bidder: 'optimera',
  params: {
    custom: {
      clientId: '1234'
    }
  }
}

An external lib is needed and can be added to the site's footer:

<script src="https://s3.amazonaws.com/elasticbeanstalk-us-east-1-397719490216/external_json/oPS.js"></script>

contact email of the adapter’s maintainer
[email protected]

  • official adapter submission

Other information

Test Page:
http://optimera.elasticbeanstalk.com/prebidDemoPage.php
@kcandiotti

Relates to PR: #1617

@kcandiotti kcandiotti mentioned this pull request Oct 24, 2017
9 tasks
@snapwich snapwich self-assigned this Oct 25, 2017
@snapwich snapwich self-requested a review October 25, 2017 15:48
}
];
it('buildRequests fires', () => {
var request = spec.buildRequests(validBidRequests);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You appear to be missing some assertions

* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bidRequest) {
return !!(bidRequest.params.custom.clientID);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will throw an exception custom.clientID is not present. Should do safe evaluation, isBidRequestValid should not throw.

var timestamp = Math.round(new Date().getTime() / 1000);
var clientID = validBidRequests[0].params.custom.clientID;
var oDv = [];
if (clientID != undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

preferred method for undefined check in javascript is if (typeof clientID !== 'undefined') {

if (clientID != undefined) {
oDv.push(clientID);
for (var i = 0; i < validBidRequests.length; i++) {
oDv.push(validBidRequests[i].placementCode);
Copy link
Collaborator

Choose a reason for hiding this comment

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

bid.placementCode has been deprecated, should be replaced with bid.adUnitCode

oDv.push(validBidRequests[i].placementCode);
}
window.oDv = oDv;
var scoresURL = SCORES_BASE_URL + clientID + '/' + optimeraHost + optimeraPathName + '.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like JSONP.

1.0 adapters should use AJAX capable endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this call, the platform generates a static js file with the JSON set to a var, so there isn't a callback. We are able to parse it from serverRsponse.body in interpretResponse. We were hoping as long as this works ok it would be fine for now until the platform can be updated.

@mcallari
Copy link
Contributor Author

mcallari commented Nov 2, 2017

Hi @snapwich, the latest changes have been pushed.

for (var i = 0; i < validBidRequests.length; i++) {
oDv.push(validBidRequests[i].adUnitCode);
}
window.oDv = oDv;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If your adapter is dependent on this global, then your adapter will not work with concurrent auctions (which is a requirement of 1.0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. This is out and we can do it elsewhere.

Copy link
Collaborator

@snapwich snapwich left a comment

Choose a reason for hiding this comment

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

LGTM, probably needs another review though

@matthewlane matthewlane self-requested a review December 2, 2017 00:33
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.

One change requested. Also, when testing this locally and on your test page, getting a 403 (Forbidden) response from the SCORES_BASE_URL -- is this still the right endpoint for your adapter?

dealId = scores[validBids[i].adUnitCode];
}
var bidResponse = {
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

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 ok, I removed the bidderCode. Yes, that endpoint is correct, we just had an error and that has been restored. The Travis build failed, but passes on my local. Can you rerun the build? Thank you.

interpretResponse: function (serverResponse, bidRequest) {
var scores = serverResponse.body.replace('window.oVa = ', '');
scores = scores.replace(';', '');
scores = JSON.parse(scores);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any JSON.parse calls will need to be in a try/catch block

}
var bidResponse = {
requestId: validBids[i].bidId,
ad: '<div></div>',
Copy link
Member

Choose a reason for hiding this comment

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

this might have been mentioned before, but how do you render the ad if there is no ad content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @mkendall07, we are just creating this adpator to add visibility scores for the ad divs that will be added to DFP calls.

Copy link
Member

Choose a reason for hiding this comment

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

Ok but what does a publisher do with that information? And why is a request to your endpoint required to calculate viewability?

@kcandiotti
Copy link

@mkendall07 Hi there. We are building this adapter specifically for a use case that a client wanted. Our technology is a targeting tech that normally pushes data directly into DFP in the header. We are utilizing prebid as a way to push data points into DFP so the client does not need to change their hardcode in order to work with us. The client will already know what to do with this data in their ad platform because of our preexisting relationship.

@mkendall07
Copy link
Member

@kcandiotti
Thanks for the information.

Due to the reliance on an external script, we aren't going to accept this adapter into the 1.0 version of prebid.

We will be publishing some guidelines about how you can include open source external resource dependencies in just a bit. Once that is out, you can resubmit the adapter. Thanks for your patience.

@mkendall07 mkendall07 closed this Dec 6, 2017
@ndhimehta ndhimehta removed the ready label Dec 6, 2017
@mcallari mcallari mentioned this pull request Dec 14, 2017
2 tasks
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.

7 participants