-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
A4G prebid adapter #1650
Closed
Closed
A4G prebid adapter #1650
Changes from 11 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
58ff158
Add A4G prebid adapter
kononenko-a-m 36da477
Changed a4gBidFactory
adilets a32ac6c
Code refactoring
adilets 5e6705a
Code refactoring
adilets 6eff99d
Code refactoring to Prebid.js 1.0
adilets b2da81d
http -> https (#1651)
Yann-Pravo 2fd1fd7
Add publisher sub-id support to the Criteo adapter (#1629)
Spark-NF e508a64
Adxcg analytics adapter (#1599)
adxcgcom 3ef99d0
Add placementId request param to Yieldmo bid adapter (#1632)
cdoher01 6b6a1fb
fixed PBS cookie syncs (#1637)
harpere c0a608d
Add ignore-loader to handle .md files (#1646)
thewizarodofoz 684ddf3
Add JSDoc for `pbjs.getAllWinningBids` (#1566)
rmloveland fed1688
rubicon converted to bidderFactory (#1624)
snapwich d566700
Revert changes for switch between client side and server side. (#1653)
aef474d
Support aspect ratio specification for native images (#1634)
matthewlane 219f5f9
Appnexus ast unittest updates (#1654)
jaiminpanchal27 36f4ba7
PulsePoint Lite adpater changes (#1630)
anand-venkatraman abb7d45
Add native param support to mediaTypes (#1625)
matthewlane 0ab545e
Prebid 0.30.0 Release
jaiminpanchal27 0bc0b29
Increment pre version
jaiminpanchal27 a69ec25
Code refactoring to Prebid.js 1.0
adilets 42282f5
prebidAdapter secure support (#1655)
bretg 6186a2c
Aliasbidder fix (#1652)
jaiminpanchal27 a9dda35
fixes bug for IE when invalid value passed to parse (#1657)
jaiminpanchal27 a2db7c4
Remove undefined variable usage (#1662)
matthewlane 731c7e4
Prebid 0.30.1 Release
jaiminpanchal27 a907a4a
remove bidmanager from rubicon tests (#1671)
snapwich f40f0e3
no longer attaching gpt slots to adUnits, which breaks utils.cloneJso…
harpere 2988065
Fix adapter tests that hardcoded pbjs. (#1666)
mattpr 2f58bb0
Fix broken AOL mobile endpoint secure bid requests (#1684)
kizzard fc9cbfb
Update spotx video adapter to set the spotx_ad_key used in DFP (#1614)
npeceniak 4eff79f
PulsePoint Lite adapter - Enabling Sync pixel (#1686)
anand-venkatraman e1f2d08
Code improvement for trustx adapter (#1673)
PWyrembak a20c3f8
Change Default Content-Type for POST Requests to 'application/json' (…
3f8021c
AppnexusAst bidadapter markdown file (#1696)
jaiminpanchal27 209921c
AppnexusAst adapter: logging error message from endpoint (#1697)
jaiminpanchal27 5bfcdc4
Add ad units event (#1702)
hhhjort 1ed7fb5
Update JSDoc for `pbjs.enableAnalytics` (#1565)
rmloveland c89e911
Don't set non-object configurations (#1704)
matthewlane 54edd80
Renaming of "huddledmasses" adapter into colossusssp (#1701)
9b5b211
Rubicon feature/s2s test module (#1678)
harpere ac40506
Fixes: Immediate adapter response may end auction (#1690)
jaiminpanchal27 17115fc
Initial commit for video support for pbs (#1706)
819f8fc
Support native click tracking (#1691)
matthewlane d0140eb
Prebid 0.31.0 Release
jaiminpanchal27 e74ea2a
Fix for #1628 (allowing standard bidCpmAdjustment) (#1645)
dugwood 75f6dc5
Increment pre version
jaiminpanchal27 89a8ed6
Update AdButler adapter for Prebid v1.0 (#1664)
dharton bd88352
Update Beachfront adapter for v1.0 (#1675)
jsalis b721d6f
Update JSDoc to call the module `pbjs` (#1572)
rmloveland 37b218a
realvuBidAdapter (#1571)
tchibirev a7a73fd
Updating license (#1717)
pdezwart be21952
Justpremium Adapter bugfix (#1716)
mkalafior a45387d
Allow more than one placement from one page (#1692)
FeatureForwardDev 505f7f3
fix log message not displaying when referencing missing bidder (#1737)
snapwich f8bf197
Fix window.top.host cross origin issue when in nested iframes. (#1730)
bansawbanchee 409fbc5
Platform.io Bidder Adapter update. Prebid v1.0. (#1705)
varashellov 755f193
Finished an unfinished comment. (#1749)
dbemiller 8aecd9a
UPDATE to Prebid.js 1.0
adilets 1375602
commit for test
adilets 80c9577
commit for test
adilets d547e51
Updated to Prebid version 1.0
adilets 450d4ab
Updated to Prebid version 1.0
adilets 923adfb
Update JCM Adapter to 1.0 (#1715)
JCarterGw 19deb8e
add option to run tests in a specific file (#1727)
thewizarodofoz 88af47b
Make response headers available to the specs (#1748)
dbemiller 403a991
Upgrade Audience Network adapter for Prebid 1.0 (#1750)
lovell 32196ae
Fix TypeError condition when bid is empty (#1769)
matthewlane 1b0439f
Validating bid response params (#1738)
jaiminpanchal27 698c330
nanointeractive bid adapter (#1627)
rade-popovic 15b2798
Fixed the argument type on getUserSyncs. (#1767)
dbemiller c730f95
Update Improve Digital adapter for Prebid 1.0 (#1728)
jbartek25 6a0c5ca
Migrating TrustX adapter to 1.0 (#1709)
PWyrembak caec5c0
Fix test-coverage bug (#1765)
dbemiller 9a6ddc2
Update Conversant adapter to Prebid 1.0 (#1711)
pycnvr edc2274
Add AdOcean adapter (#1735)
jdrobiecki d4a1423
updated for prebid 1.0 api (#1722)
ckbo3hrk ebaec7a
Kargo Adapter for Prebid 1.0 (#1729)
samuelhorwitz c5d1ecf
Fidelity Media Adapter update. Prebid v1.0 (#1719)
onaydenov 51ffb4e
Upgrade Quantcast adapter for Prebid 1.0 (#1753)
90c66f2
Update yieldmoBid adapter request url (#1771)
cdoher01 d5f1cd1
Update adxcg adapter for prebid 1.0 (#1741)
adxcgcom 8e5dedf
Add A4G prebid adapter
kononenko-a-m e96a7e5
Changed a4gBidFactory
adilets 2db8f61
Code refactoring
adilets 3dcb12e
Code refactoring
adilets 73e1814
Code refactoring to Prebid.js 1.0
adilets 3937408
Code refactoring to Prebid.js 1.0
adilets 3f47e77
UPDATE to Prebid.js 1.0
adilets 4e36e3a
commit for test
adilets 09b30fe
commit for test
adilets 2b1b1a0
Updated to Prebid version 1.0
adilets ddca775
Updated to Prebid version 1.0
adilets 67c6733
Updated to Prebid version 1.0
adilets 61f9811
Merge remote-tracking branch 'origin/master'
adilets 638a95d
Updated to Prebid version 1.0
adilets 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 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,77 @@ | ||
import {registerBidder} from 'src/adapters/bidderFactory'; | ||
import * as utils from 'src/utils'; | ||
|
||
const A4G_BIDDER_CODE = 'a4g'; | ||
const A4G_CURRENCY = 'USD'; | ||
const A4G_DEFAULT_BID_URL = '//ads.ad4game.com/v1/bid'; | ||
const A4G_TTL = 120; | ||
|
||
const LOCATION_PARAM_NAME = 'siteurl'; | ||
const ID_PARAM_NAME = 'id'; | ||
const ZONE_ID_PARAM_NAME = 'zoneId'; | ||
const SIZE_PARAM_NAME = 'size'; | ||
|
||
const ARRAY_PARAM_SEPARATOR = ';'; | ||
const ARRAY_SIZE_SEPARATOR = ','; | ||
const SIZE_SEPARATOR = 'x'; | ||
|
||
export const spec = { | ||
code: A4G_BIDDER_CODE, | ||
isBidRequestValid: function(bid) { | ||
return bid.params && !!bid.params.zoneId; | ||
}, | ||
|
||
buildRequests: function(validBidRequests) { | ||
let deliveryUrl = ''; | ||
const idParams = []; | ||
const sizeParams = []; | ||
const zoneIds = []; | ||
|
||
utils._each(validBidRequests, function(bid) { | ||
if (!deliveryUrl && typeof bid.params.deliveryUrl === 'string') { | ||
deliveryUrl = bid.params.deliveryUrl; | ||
} | ||
idParams.push(bid.adUnitCode); | ||
sizeParams.push(bid.sizes.map(size => size.join(SIZE_SEPARATOR)).join(ARRAY_SIZE_SEPARATOR)); | ||
zoneIds.push(bid.params.zoneId); | ||
}); | ||
|
||
if (!deliveryUrl) { | ||
deliveryUrl = A4G_DEFAULT_BID_URL; | ||
} | ||
|
||
return { | ||
method: 'GET', | ||
url: deliveryUrl, | ||
data: { | ||
[LOCATION_PARAM_NAME]: utils.getTopWindowUrl(), | ||
[SIZE_PARAM_NAME]: sizeParams.join(ARRAY_PARAM_SEPARATOR), | ||
[ID_PARAM_NAME]: idParams.join(ARRAY_PARAM_SEPARATOR), | ||
[ZONE_ID_PARAM_NAME]: zoneIds.join(ARRAY_PARAM_SEPARATOR) | ||
} | ||
}; | ||
}, | ||
|
||
interpretResponse: function(serverResponses, request) { | ||
const bidResponses = []; | ||
utils._each(serverResponses, function(response) { | ||
const bidResponse = { | ||
requestId: request.bidId, | ||
bidderCode: spec.code, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
cpm: response.cpm, | ||
width: response.width, | ||
height: response.height, | ||
creativeId: response.zoneid, | ||
currency: A4G_CURRENCY, | ||
netRevenue: true, | ||
ttl: A4G_TTL, | ||
ad: response.ad | ||
}; | ||
bidResponses.push(bidResponse); | ||
}); | ||
|
||
return bidResponses; | ||
} | ||
}; | ||
|
||
registerBidder(spec); |
This file contains 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,40 @@ | ||
# Overview | ||
|
||
Module Name: Ad4Game Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: [email protected] | ||
|
||
# Description | ||
|
||
Ad4Game Bidder Adapter for Prebid.js | ||
|
||
# Test Parameters | ||
``` | ||
var adUnits = [ | ||
{ | ||
code: 'test-div', | ||
sizes: [[300, 250]], // a display size | ||
bids: [ | ||
{ | ||
bidder: 'a4g', | ||
params: { | ||
zoneId: 59304, | ||
deliveryUrl: 'http://dev01.ad4game.com/v1/bid' | ||
} | ||
} | ||
] | ||
},{ | ||
code: 'test-div', | ||
sizes: [[300, 50]], // a mobile size | ||
bids: [ | ||
{ | ||
bidder: 'a4g', | ||
params: { | ||
zoneId: 59354, | ||
deliveryUrl: 'http://dev01.ad4game.com/v1/bid' | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
``` |
This file contains 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,126 @@ | ||
import { expect} from 'chai'; | ||
import { spec } from 'modules/a4gBidAdapter'; | ||
|
||
describe('a4gAdapterTests', () => { | ||
describe('bidRequestValidity', () => { | ||
it('bidRequest with zoneId and deliveryUrl params', () => { | ||
expect(spec.isBidRequestValid({ | ||
bidder: 'a4g', | ||
params: { | ||
zoneId: 59304, | ||
deliveryUrl: 'http://dev01.ad4game.com/v1/bid' | ||
} | ||
})).to.equal(true); | ||
}); | ||
|
||
it('bidRequest with only zoneId', () => { | ||
expect(spec.isBidRequestValid({ | ||
bidder: 'a4g', | ||
params: { | ||
zoneId: 59304 | ||
} | ||
})).to.equal(true); | ||
}); | ||
|
||
it('bidRequest with only deliveryUrl', () => { | ||
expect(spec.isBidRequestValid({ | ||
bidder: 'a4g', | ||
params: { | ||
deliveryUrl: 'http://dev01.ad4game.com/v1/bid' | ||
} | ||
})).to.equal(false); | ||
}); | ||
}); | ||
|
||
describe('bidRequest', () => { | ||
const bidRequests = [{ | ||
'bidder': 'a4g', | ||
'bidId': '51ef8751f9aead', | ||
'params': { | ||
'zoneId': 59304, | ||
}, | ||
'adUnitCode': 'div-gpt-ad-1460505748561-0', | ||
'transactionId': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', | ||
'sizes': [[320, 50], [300, 250], [300, 600]], | ||
'bidderRequestId': '418b37f85e772c', | ||
'auctionId': '18fd8b8b0bd757' | ||
}, { | ||
'bidder': 'a4g', | ||
'bidId': '51ef8751f9aead', | ||
'params': { | ||
'zoneId': 59354, | ||
'deliveryUrl': '//dev01.ad4game.com/v1/bid' | ||
}, | ||
'adUnitCode': 'div-gpt-ad-1460505748561-0', | ||
'transactionId': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', | ||
'sizes': [[320, 50], [300, 250], [300, 600]], | ||
'bidderRequestId': '418b37f85e772c', | ||
'auctionId': '18fd8b8b0bd757' | ||
}]; | ||
|
||
it('bidRequest method', () => { | ||
const request = spec.buildRequests(bidRequests); | ||
expect(request.method).to.equal('GET'); | ||
}); | ||
|
||
it('bidRequest url', () => { | ||
const request = spec.buildRequests(bidRequests); | ||
expect(request.url).to.match(new RegExp(`${bidRequests[1].params.deliveryUrl}`)); | ||
}); | ||
|
||
it('bidRequest data', () => { | ||
const request = spec.buildRequests(bidRequests); | ||
expect(request.data).to.exists; | ||
}); | ||
|
||
it('bidRequest zoneIds', () => { | ||
const request = spec.buildRequests(bidRequests); | ||
expect(request.data.zoneId).to.equal('59304;59354'); | ||
}); | ||
}); | ||
|
||
describe('interpretResponse', () => { | ||
const bidRequest = [{ | ||
'bidder': 'a4g', | ||
'bidId': '51ef8751f9aead', | ||
'params': { | ||
'zoneId': 59304, | ||
}, | ||
'adUnitCode': 'div-gpt-ad-1460505748561-0', | ||
'transactionId': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec', | ||
'sizes': [[320, 50], [300, 250], [300, 600]], | ||
'bidderRequestId': '418b37f85e772c', | ||
'auctionId': '18fd8b8b0bd757' | ||
}]; | ||
|
||
const bidResponse = [{ | ||
'id': 'div-gpt-ad-1460505748561-0', | ||
'ad': 'test ad', | ||
'width': 320, | ||
'height': 250, | ||
'cpm': 5.2 | ||
}]; | ||
|
||
it('required keys', () => { | ||
const result = spec.interpretResponse(bidResponse, bidRequest); | ||
|
||
let requiredKeys = [ | ||
'requestId', | ||
'bidderCode', | ||
'cpm', | ||
'width', | ||
'height', | ||
'ad', | ||
'ttl', | ||
'creativeId', | ||
'netRevenue', | ||
'currency' | ||
]; | ||
|
||
let resultKeys = Object.keys(result[0]); | ||
resultKeys.forEach(function(key) { | ||
expect(requiredKeys.indexOf(key) !== -1).to.equal(true); | ||
}); | ||
}) | ||
}); | ||
}); |
This file contains 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
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.
#1748 changed the first argument of
interpretResponse
to:so updating
serverResponses
toserverResponses.body
(and in corresponding tests if needed) should do the trick. May need to rebase off of master first