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

Ventes Bid Adapter: add new bid adapter #7525

Merged
merged 38 commits into from
Oct 20, 2021

Conversation

jessoventes
Copy link
Contributor

@jessoventes jessoventes commented Oct 1, 2021

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
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

  • test parameters for validating bids
{
  bidder: '<bidder name>',
  params: {
    // ...
  }
}

Be sure to test the integration with your adserver using the Hello World sample page.

  • contact email of the adapter’s maintainer
  • official adapter submission

For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:

Other information

@lgtm-com
Copy link

lgtm-com bot commented Oct 1, 2021

This pull request introduces 1 alert when merging 2939458 into 80bc6e2 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@jessoventes
Copy link
Contributor Author

Please advise next step to add bid Adapter in prebid.js. Thanks

@ChrisHuie ChrisHuie changed the title Ventes bid adapter Ventes Bid Adapter: add new bid adapter Oct 1, 2021
@ChrisHuie
Copy link
Collaborator

@jessoventes can you please add unit testing for this new adapter?

@Rothalack
Copy link
Collaborator

@jessoventes I see. If device.ip is required for a valid bid, you'll want to add that to your dev docs so users know: https://github.com/prebid/prebid.github.io/pull/3309/files

And from the perspective of publishers trying to use your bidder, making IP required is going to limit how many publishers can implement your bidder. Many publishers are not creating their own scripts and are not capable of making them dynamic by page load. That's just my opinion on it at least.

@jessoventes
Copy link
Contributor Author

@jessoventes I see. If device.ip is required for a valid bid, you'll want to add that to your dev docs so users know: https://github.com/prebid/prebid.github.io/pull/3309/files

And from the perspective of publishers trying to use your bidder, making IP required is going to limit how many publishers can implement your bidder. Many publishers are not creating their own scripts and are not capable of making them dynamic by page load. That's just my opinion on it at least.

@Rothalack Even i observed other adapters, i too believe ip will restrict publishers. Let me go through the server side changes to remove ip so that even without ip, we can go ahead. Thanks for the suggestion!!

@jessoventes
Copy link
Contributor Author

jessoventes commented Oct 18, 2021

@jessoventes I see. If device.ip is required for a valid bid, you'll want to add that to your dev docs so users know: https://github.com/prebid/prebid.github.io/pull/3309/files
And from the perspective of publishers trying to use your bidder, making IP required is going to limit how many publishers can implement your bidder. Many publishers are not creating their own scripts and are not capable of making them dynamic by page load. That's just my opinion on it at least.

@Rothalack Even i observed other adapters, i too believe ip will restrict publishers. Let me go through the server side changes to remove ip so that even without ip, we can go ahead. Thanks for the suggestion!!

@Rothalack @ChrisHuie Required changes to serve request without ip is done at our server, can you please go ahead and check and confirm if everything is fine?

@jessoventes
Copy link
Contributor Author

@jessoventes I see. If device.ip is required for a valid bid, you'll want to add that to your dev docs so users know: https://github.com/prebid/prebid.github.io/pull/3309/files
And from the perspective of publishers trying to use your bidder, making IP required is going to limit how many publishers can implement your bidder. Many publishers are not creating their own scripts and are not capable of making them dynamic by page load. That's just my opinion on it at least.

@Rothalack Even i observed other adapters, i too believe ip will restrict publishers. Let me go through the server side changes to remove ip so that even without ip, we can go ahead. Thanks for the suggestion!!

@Rothalack @ChrisHuie Required changes to serve request without ip is done at our server, can you please go ahead and check and confirm if everything is fine?

@ChrisHuie @Rothalack Any update for us here?

@Rothalack
Copy link
Collaborator

Hey @jessoventes I was able to test this morning. I'm getting a new error when trying to request a bid:
utils.js:272

   Prebid ERROR: ventes Bid Adapter emitted an uncaught error when parsing their bidRequest {e: TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
at generateBidRequest…, bidRequest: {…}}bidRequest: {bidderCode: 'ventes', auctionId: '56212912-b1b5-47a8-9acc-5beba4d3940f', bidderRequestId: '1fbd72cad28ef5', bids: Array(1), auctionStart: 1634650355546, …}e: TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
at generateBidRequestsFromAdUnits (http://localhost:9999/build/dev/prebid.js:153353:23)
at createServerRequestFromAdUnits (http://localhost:9999/build/dev/prebid.js:153296:11)
at http://localhost:9999/build/dev/prebid.js:153580:14
at Array.map (<anonymous>)
at Object.buildRequests (http://localhost:9999/build/dev/prebid.js:153574:52)
at Object.callBids (http://localhost:9999/build/dev/prebid.js:1869:27)
at Object.runWithBidder (http://localhost:9999/build/dev/prebid.js:7900:14)
at http://localhost:9999/build/dev/prebid.js:13364:66
at Array.forEach (<anonymous>)
at Object.8.adapterManager.callBids (http://localhost:9999/build/dev/prebid.js:13349:21)message: "Cannot read properties of undefined (reading 'hasOwnProperty')"stack: "TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')\n    at generateBidRequestsFromAdUnits (http://localhost:9999/build/dev/prebid.js:153353:23)\n    at createServerRequestFromAdUnits (http://localhost:9999/build/dev/prebid.js:153296:11)\n    at http://localhost:9999/build/dev/prebid.js:153580:14\n    at Array.map (<anonymous>)\n    at Object.buildRequests (http://localhost:9999/build/dev/prebid.js:153574:52)\n    at Object.callBids (http://localhost:9999/build/dev/prebid.js:1869:27)\n    at Object.runWithBidder (http://localhost:9999/build/dev/prebid.js:7900:14)\n    at http://localhost:9999/build/dev/prebid.js:13364:66\n    at Array.forEach (<anonymous>)\n    at Object.8.adapterManager.callBids (http://localhost:9999/build/dev/prebid.js:13349:21)"[[Prototype]]: Errorconstructor: ƒ TypeError()message: ""name: "TypeError"[[Prototype]]: Object[[Prototype]]: Object

logError @ utils.js:272

@jessoventes
Copy link
Contributor Author

Hey @jessoventes I was able to test this morning. I'm getting a new error when trying to request a bid: utils.js:272

   Prebid ERROR: ventes Bid Adapter emitted an uncaught error when parsing their bidRequest {e: TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
at generateBidRequest…, bidRequest: {…}}bidRequest: {bidderCode: 'ventes', auctionId: '56212912-b1b5-47a8-9acc-5beba4d3940f', bidderRequestId: '1fbd72cad28ef5', bids: Array(1), auctionStart: 1634650355546, …}e: TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
at generateBidRequestsFromAdUnits (http://localhost:9999/build/dev/prebid.js:153353:23)
at createServerRequestFromAdUnits (http://localhost:9999/build/dev/prebid.js:153296:11)
at http://localhost:9999/build/dev/prebid.js:153580:14
at Array.map (<anonymous>)
at Object.buildRequests (http://localhost:9999/build/dev/prebid.js:153574:52)
at Object.callBids (http://localhost:9999/build/dev/prebid.js:1869:27)
at Object.runWithBidder (http://localhost:9999/build/dev/prebid.js:7900:14)
at http://localhost:9999/build/dev/prebid.js:13364:66
at Array.forEach (<anonymous>)
at Object.8.adapterManager.callBids (http://localhost:9999/build/dev/prebid.js:13349:21)message: "Cannot read properties of undefined (reading 'hasOwnProperty')"stack: "TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')\n    at generateBidRequestsFromAdUnits (http://localhost:9999/build/dev/prebid.js:153353:23)\n    at createServerRequestFromAdUnits (http://localhost:9999/build/dev/prebid.js:153296:11)\n    at http://localhost:9999/build/dev/prebid.js:153580:14\n    at Array.map (<anonymous>)\n    at Object.buildRequests (http://localhost:9999/build/dev/prebid.js:153574:52)\n    at Object.callBids (http://localhost:9999/build/dev/prebid.js:1869:27)\n    at Object.runWithBidder (http://localhost:9999/build/dev/prebid.js:7900:14)\n    at http://localhost:9999/build/dev/prebid.js:13364:66\n    at Array.forEach (<anonymous>)\n    at Object.8.adapterManager.callBids (http://localhost:9999/build/dev/prebid.js:13349:21)"[[Prototype]]: Errorconstructor: ƒ TypeError()message: ""name: "TypeError"[[Prototype]]: Object[[Prototype]]: Object

logError @ utils.js:272

Can you share the request as well?

@Rothalack
Copy link
Collaborator

Here's a request that gave the same error:
[
{
"bidderCode": "ventes",
"auctionId": "481513c4-ca77-4795-9551-1f4e26f3b349",
"bidderRequestId": "194f3cab4f45b",
"bids": [
{
"bidder": "ventes",
"params": {
"placementId": "VA-062-0013-0183",
"publisherId": "5cebea3c9eea646c7b623d5e"
},
"crumbs": {
"pubcid": "6d599ea5-7a5e-4026-a8cc-bc36054a585e"
},
"ortb2Imp": {
"ext": {
"data": {
"adserver": {
"name": "gam",
"adslot": "/19968336/header-bid-tag-0"
},
"pbadslot": "/19968336/header-bid-tag-0"
}
}
},
"mediaTypes": {
"banner": {
"sizes": [
[
300,
250
]
]
}
},
"adUnitCode": "div-gpt-ad-1460505748561-0",
"transactionId": "7f527243-7375-4029-9e2e-39de9b8e08c9",
"sizes": [
[
300,
250
]
],
"bidId": "2d43c4f61be23a",
"bidderRequestId": "194f3cab4f45b",
"auctionId": "481513c4-ca77-4795-9551-1f4e26f3b349",
"src": "client",
"bidRequestsCount": 1,
"bidderRequestsCount": 1,
"bidderWinsCount": 0
}
],
"auctionStart": 1634651988851,
"timeout": 1000,
"refererInfo": {
"referer": "http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true",
"reachedTop": true,
"isAmp": false,
"numIframes": 0,
"stack": [
"http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true"
],
"canonicalUrl": null
},
"start": 1634651988858
}
]

For publisherId, I tried both 5cebea3c9eea646c7b623d5e and VA-062 and both give the same error. Is there other required params other than placementId and publisherId? The other params are listed as optional in your docs.

@jessoventes
Copy link
Contributor Author

jessoventes commented Oct 19, 2021

@Rothalack Thank you to address about the error!!
There was a code error as user agent wasn't getting added in request for website and in case of mobile device request, ifa id is mandatory in device object. I have updated the doc. You can go ahead and check it now. Can you please check with web placement 'VA-002-0007-0799'
So if you are using VA-002-0007-0799, then only placementId and publisherId is required.
And if using VA-062-0013-0183, then both are mandatory, including device object with ifa id in it, app object with app-id in it.

@Rothalack
Copy link
Collaborator

When testing on desktop in browser using
placementId: 'VA-002-0007-0799',
publisherId: '5cebea3c9eea646c7b623d5e'
I'm still getting the TypeError: Cannot read properties of undefined (reading 'hasOwnProperty').
When I try to include device.ifa and app.id, I just get a server error from your end. I'm honestly not sure how to do a true test of this in a mobile environment.

@jessoventes
Copy link
Contributor Author

5cebea3c9eea646c7b623d5e

@Rothalack I tried testing using a html page sample code provided on the official website and used adUtils as below:
I am able to get the banner ad in the div.
var adUnits = [
{
code: '/19968336/header-bid-tag-0',
mediaTypes: {
banner: {
sizes: div_1_sizes
}
},
bids: [{
bidder: 'ventes',
params: {
publisherId: '5cebea3c9eea646c7b623d5e',
placementId: 'VA-002-0007-0799'
}
}]
}
];

Also, i checked yesterday's logs i am able to see 4 request to our server was responded with ad.
Is it possible for you to share the stack trace for the error occurring for 'hasOwnProperty'? Is is possible for you to get on a call to solve this issue?
Thanks!!

@Rothalack
Copy link
Collaborator

Rothalack commented Oct 20, 2021

I'm getting a different error now.

I'm using the hello_world test page in integrationExamples/gpt/hello_world.html

Testing with 300x250 size. placementId VA-002-0007-0799, publisherId 5cebea3c9eea646c7b623d5e
`var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizes: [[300, 250]],
}
},
// Replace this object to test a new Adapter!
bids: [{
bidder: 'ventes',
params: {
placementId: 'VA-002-0007-0799',
publisherId: '5cebea3c9eea646c7b623d5e'
}
}]

    }];`

The stack trace is:
Prebid ERROR: ventes Bid Adapter emitted an uncaught error when parsing their bidRequest Object { e: TypeError, bidRequest: {…} } utils.js:272:18 logError utils.js:272 callBids adapterManager.js:447 callBids adapterManager.js:419 run auction.js:252 runIfOriginHasCapacity auction.js:315 addBidderRequestsCallback auction.js:284 addBidderRequests auction.js:363 targetIndex index.js:342 next index.js:328 addBidderRequestHook index.js:38 next index.js:328 adjustBidderRequestsHook index.js:92 next index.js:328 trap index.js:347 callBids auction.js:225 requestBids prebid.js:637 targetIndex index.js:342 next index.js:328 requestBidHook pubCommonId.js:223 next index.js:328 executeCallbacks prebid.js:643 next index.js:328 trap index.js:347 <anonymous> hello_world.html:50 processQueue prebid.js:995 processQueue prebid.js:992 processQueue prebid.js:1009 <anonymous> prebid.js:161296

The error object is:
{ "e": {}, "bidRequest": { "bidderCode": "ventes", "auctionId": "147e0e82-cdb1-4e3f-842a-045d9fc1169f", "bidderRequestId": "14a66d4d488a8e", "bids": [ { "bidder": "ventes", "params": { "placementId": "VA-002-0007-0799", "publisherId": "5cebea3c9eea646c7b623d5e" }, "crumbs": { "pubcid": "9a87dcff-1991-4df7-b098-bd55655245ec" }, "ortb2Imp": { "ext": { "data": { "pbadslot": "div-gpt-ad-1460505748561-0" } } }, "mediaTypes": { "banner": { "sizes": [ [ 300, 250 ] ] } }, "adUnitCode": "div-gpt-ad-1460505748561-0", "transactionId": "eeee9af1-f28b-4db0-a5b3-c15b76874e16", "sizes": [ [ 300, 250 ] ], "bidId": "24b380734b4cd48", "bidderRequestId": "14a66d4d488a8e", "auctionId": "147e0e82-cdb1-4e3f-842a-045d9fc1169f", "src": "client", "bidRequestsCount": 1, "bidderRequestsCount": 1, "bidderWinsCount": 0 } ], "auctionStart": 1634749629812, "timeout": 1000, "refererInfo": { "referer": "http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true", "reachedTop": true, "isAmp": false, "numIframes": 0, "stack": [ "http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true" ], "canonicalUrl": null }, "start": 1634749629846 } }

The TypeError is showing this;

e: TypeError: deviceObjBid is undefined columnNumber: 9 fileName: "http://localhost:9999/build/dev/prebid.js" lineNumber: 153353 message: "deviceObjBid is undefined" stack: "generateBidRequestsFromAdUnits@http://localhost:9999/build/dev/prebid.js:153353:9\ncreateServerRequestFromAdUnits@http://localhost:9999/build/dev/prebid.js:153296:11\nbuildRequests/<@http://localhost:9999/build/dev/prebid.js:153577:14\nbuildRequests@http://localhost:9999/build/dev/prebid.js:153571:52\ncallBids@http://localhost:9999/build/dev/prebid.js:1869:27\nrunWithBidder@http://localhost:9999/build/dev/prebid.js:7900:14\n8/adapterManager.callBids/<@http://localhost:9999/build/dev/prebid.js:13364:66\n8/adapterManager.callBids@http://localhost:9999/build/dev/prebid.js:13349:21\nrun@http://localhost:9999/build/dev/prebid.js:6560:24\nrunIfOriginHasCapacity@http://localhost:9999/build/dev/prebid.js:6628:14\naddBidderRequestsCallback@http://localhost:9999/build/dev/prebid.js:6598:10\n28/addBidderRequests<@http://localhost:9999/build/dev/prebid.js:6692:17\ntrap/order[targetIndex]@http://localhost:9999/build/dev/prebid.js:5136:33\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\naddBidderRequestHook@http://localhost:9999/build/dev/prebid.js:64073:6\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\nadjustBidderRequestsHook@http://localhost:9999/build/dev/prebid.js:97002:6\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\ntrap@http://localhost:9999/build/dev/prebid.js:5141:16\ncallBids@http://localhost:9999/build/dev/prebid.js:6534:25\n79/pbjs.requestBids<@http://localhost:9999/build/dev/prebid.js:12467:11\ntrap/order[targetIndex]@http://localhost:9999/build/dev/prebid.js:5136:33\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\nrequestBidHook@http://localhost:9999/build/dev/prebid.js:112771:15\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\nexecuteCallbacks@http://localhost:9999/build/dev/prebid.js:12472:6\nnext@http://localhost:9999/build/dev/prebid.js:5122:36\ntrap@http://localhost:9999/build/dev/prebid.js:5141:16\n@http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true:50:18\nprocessQueue/<@http://localhost:9999/build/dev/prebid.js:12845:13\nprocessQueue@http://localhost:9999/build/dev/prebid.js:12842:9\n79/pbjs.processQueue@http://localhost:9999/build/dev/prebid.js:12860:15\n@http://localhost:9999/build/dev/prebid.js:161296:6\n"

What I'm thinking is how you've set up device to be interpreted, it's still being "required".

@jessoventes
Copy link
Contributor Author

153353

Fixed the issue.Can you check now?
Also, can you help me how can i build ventesBidAdapter to Prebid.js under folder build/dev/prebid.js.

@Rothalack
Copy link
Collaborator

I tested again and was only getting a server error from your end. So what I did next was get my ifa id from my personal phone and added device.ifa to the bid request. Once I added that, I started getting ads served. So I can call this good to go and working.

It looks like your adapter is in build/dev. I'm honestly unsure how you can build into the prebid file. I don't see why you would need too either. I think you're configured properly.

@jessoventes
Copy link
Contributor Author

properly
Ok, Thanks @Rothalack . Can you let me know next steps?

@Rothalack
Copy link
Collaborator

You will want to make sure your docs over here: prebid/prebid.github.io#3309 are accurate and up to date. I won't hold up this PR for that.

It looks like we've missed the cut off for release this week. Apologies for that, I recently reinstalled my OS on this machine and had to get a prebid dev environment set up and running on it today, it never works first try of course. So I will be merging this in shortly and it should go out next week.

@jessoventes
Copy link
Contributor Author

You will want to make sure your docs over here: prebid/prebid.github.io#3309 are accurate and up to date. I won't hold up this PR for that.

It looks like we've missed the cut off for release this week. Apologies for that, I recently reinstalled my OS on this machine and had to get a prebid dev environment set up and running on it today, it never works first try of course. So I will be merging this in shortly and it should go out next week.

Thanks @Rothalack . Yes, once it is release we could make required changes in case of any issue faced by publishers. Meanwhile, I will confirm the docs and update it if required.

@Rothalack Rothalack merged commit 191a3cb into prebid:master Oct 20, 2021
@jessoventes
Copy link
Contributor Author

@Rothalack Just wanted to check, the release date for this merge. Thanks!!

@Rothalack
Copy link
Collaborator

@Rothalack Just wanted to check, the release date for this merge. Thanks!!

Normally releases on Weds. Assuming there's no issues that pop up, should be out tomorrow.

@jessoventes
Copy link
Contributor Author

@Rothalack Just wanted to check, the release date for this merge. Thanks!!

Normally releases on Weds. Assuming there's no issues that pop up, should be out tomorrow.

Ok. Thanks.

@jessoventes
Copy link
Contributor Author

@Rothalack In the release of 6.0.0, i am not able to see Bid adapter of "ventes", can you please help me here.

@Rothalack
Copy link
Collaborator

You're in the previous release
https://github.com/prebid/Prebid.js/releases/tag/5.20.0
That release was done and then the 6.0 release was made immediately after and should include everything previous to it.

@jessoventes
Copy link
Contributor Author

You're in the previous release https://github.com/prebid/Prebid.js/releases/tag/5.20.0 That release was done and then the 6.0 release was made immediately after and should include everything previous to it.

Ok. Now able to see, Thanks

cpabst pushed a commit to sovrn/Prebid.js that referenced this pull request Jan 10, 2022
* Ventes Avenues initial changes

* Ventes Avenues initial changes

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues

* Ventes Avenues Solved issues for user agent

* Added few more info

* Ventes Avenues Solved issues for user agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants