-
Notifications
You must be signed in to change notification settings - Fork 2.3k
aceexBidAdapter/setup #14352
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
Open
rishko00
wants to merge
13
commits into
prebid:master
Choose a base branch
from
rishko00:aceexBidAdapter/setup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+413
−0
Open
aceexBidAdapter/setup #14352
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0cfc83e
aceexBidAdapter/setup
vrishko cce219d
aceexBidAdapter/setup and fixes
vrishko 740e452
aceexBidAdapter/setup merge
vrishko a41199d
aceexBidAdapter/setup merge
vrishko 9ecaa6c
Merge branch 'master' into aceexBidAdapter/setup
rishko00 91bbbe4
Merge branch 'master' into aceexBidAdapter/setup
rishko00 b3219ab
Merge branch 'master' into aceexBidAdapter/setup
rishko00 c27b7ad
prices logic fix
vrishko ea209b3
prices logic fix
vrishko 403cf9f
prices logic fix
vrishko 2758fd7
prices logic fix
vrishko 408dbda
prices logic fix
vrishko 667b4b5
prices logic fix
vrishko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| import { registerBidder } from '../src/adapters/bidderFactory.js'; | ||
| import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; | ||
| import { | ||
| buildRequestsBase, | ||
| buildPlacementProcessingFunction, | ||
| } from '../libraries/teqblazeUtils/bidderUtils.js'; | ||
|
|
||
| import { deepAccess } from '../src/utils.js'; | ||
|
|
||
| const BIDDER_CODE = 'aceex'; | ||
| const GVLID = 1387; | ||
| const AD_REQUEST_URL = 'http://bl-us.aceex.io/?secret_key=prebidjs'; | ||
|
|
||
| const addCustomFieldsToPlacement = (bid, bidderRequest, placement) => { | ||
| placement.trafficType = placement.adFormat; | ||
| placement.publisherId = bid.params.publisherId; | ||
| placement.internalKey = bid.params.internalKey; | ||
| placement.bidfloor = bid.params.bidfloor; | ||
| }; | ||
|
|
||
| const placementProcessingFunction = buildPlacementProcessingFunction({ addCustomFieldsToPlacement }); | ||
|
|
||
| export const spec = { | ||
| code: BIDDER_CODE, | ||
| gvlid: GVLID, | ||
| supportedMediaTypes: [BANNER, VIDEO, NATIVE], | ||
|
|
||
| isBidRequestValid: (bid) => { | ||
| return !!(bid.bidId && bid.params?.publisherId && bid.params?.trafficType); | ||
| }, | ||
|
|
||
| buildRequests: (validBidRequests = [], bidderRequest) => { | ||
| const base = buildRequestsBase({ adUrl: AD_REQUEST_URL, validBidRequests, bidderRequest, placementProcessingFunction }); | ||
|
|
||
| base.data.cat = deepAccess(bidderRequest, 'ortb2.cat'); | ||
| base.data.keywords = deepAccess(bidderRequest, 'ortb2.keywords'); | ||
| base.data.badv = deepAccess(bidderRequest, 'ortb2.badv'); | ||
| base.data.wseat = deepAccess(bidderRequest, 'ortb2.wseat'); | ||
| base.data.bseat = deepAccess(bidderRequest, 'ortb2.bseat'); | ||
|
|
||
| return base; | ||
| }, | ||
|
|
||
| interpretResponse: (serverResponse, bidRequest) => { | ||
| if (!serverResponse || !serverResponse.body || !Array.isArray(serverResponse.body.seatbid)) return []; | ||
|
|
||
| const repackedBids = []; | ||
|
|
||
| serverResponse.body.seatbid.forEach(seatbidItem => { | ||
| seatbidItem.bid.forEach((bid) => { | ||
| const originalPlacement = bidRequest.data.placements?.find(pl => pl.bidId === bid.id); | ||
|
|
||
| const repackedBid = { | ||
| cpm: bid.price, | ||
| creativeId: bid.crid, | ||
| currency: 'USD', | ||
| dealId: bid.dealid, | ||
| height: bid.h, | ||
| width: bid.w, | ||
| mediaType: originalPlacement.adFormat, | ||
| netRevenue: true, | ||
| requestId: bid.id, | ||
| ttl: 1200, | ||
| meta: { | ||
| advertiserDomains: bid.adomain | ||
| }, | ||
| }; | ||
|
|
||
| switch (originalPlacement.adFormat) { | ||
| case 'video': | ||
| repackedBid.vastXml = bid.adm; | ||
| break; | ||
|
|
||
| case 'banner': | ||
| repackedBid.ad = bid.adm; | ||
| break; | ||
|
|
||
| case 'native': | ||
| const nativeResponse = JSON.parse(bid.adm).native; | ||
|
|
||
| const { assets, imptrackers, link } = nativeResponse; | ||
| repackedBid.native = { | ||
| ortb: { assets, imptrackers, link }, | ||
| }; | ||
| break; | ||
|
|
||
| default: break; | ||
| }; | ||
|
|
||
| repackedBids.push(repackedBid); | ||
| }) | ||
| }); | ||
|
|
||
| return repackedBids; | ||
| }, | ||
| }; | ||
|
|
||
| registerBidder(spec); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Overview | ||
|
|
||
| ``` | ||
| Module Name: Aceex Bidder Adapter | ||
| Module Type: Bidder Adapter | ||
| Maintainer: tech@aceex.io | ||
| ``` | ||
|
|
||
| # Description | ||
|
|
||
| Module that connects Prebid.JS publishers to Aceex ad-exchange | ||
|
|
||
| # Parameters | ||
|
|
||
| | Name | Scope | Description | Example | | ||
| | :------------ | :------- | :------------------------ | :------------------- | | ||
| | `publisherId` | required | Publisher ID on platform | 219 | | ||
| | `trafficType` | required | Configures the mediaType that should be used. Values can be banner, native or video | "banner" | | ||
| | `internalKey` | required | Publisher hash on platform | "j1opp02hsma8119" | | ||
| | `bidfloor` | required | Bidfloor | 0.1 | | ||
|
|
||
| # Test Parameters | ||
| ``` | ||
| var adUnits = [ | ||
| // Will return static test banner | ||
| { | ||
| code: 'placementId_0', | ||
| mediaTypes: { | ||
| banner: { | ||
| sizes: [[300, 250]], | ||
| } | ||
| }, | ||
| bids: [ | ||
| { | ||
| bidder: 'aceex', | ||
| params: { | ||
| publisherId: 219, | ||
| internalKey: 'j1opp02hsma8119', | ||
| trafficType: 'banner', | ||
| bidfloor: 0.2 | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| // Will return test vast video | ||
| { | ||
| code: 'placementId_0', | ||
| mediaTypes: { | ||
| video: { | ||
| playerSize: [640, 480], | ||
| context: 'instream' | ||
| } | ||
| }, | ||
| bids: [ | ||
| { | ||
| bidder: 'aceex', | ||
| params: { | ||
| publisherId: 219, | ||
| internalKey: 'j1opp02hsma8119', | ||
| trafficType: 'video', | ||
| bidfloor: 1.1 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ]; | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The adapter hard-codes
meta.advertiserDomainsto['aaa.com']for every bid. This mislabels the advertiser for all responses, which can bypass publisher blocklists or incorrectly block legitimate ads, and it also violates the expectation that this field reflectsadomain/advertiser domains from the exchange. Use the response-provided domain list (e.g.,bid.adomain) or leave it empty when it’s missing.Useful? React with 👍 / 👎.