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

FeedAd Bid Adapter: add support for GDPR/TCF 2.0 & remove video support #6538

Merged
merged 34 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6813398
added file scaffold
couchcrew-thomas May 2, 2019
030a709
added isBidRequestValid implementation
couchcrew-thomas May 7, 2019
1ac46eb
added local prototype of ad integration
couchcrew-thomas May 8, 2019
fdcee20
added implementation for placement ID validation
couchcrew-thomas May 20, 2019
1938094
fixed video context filter
couchcrew-thomas May 20, 2019
478b00d
applied lint to feedad bid adapter
couchcrew-thomas May 20, 2019
494258e
added unit test for bid request validation
couchcrew-thomas May 20, 2019
c7111e8
added buildRequest unit test
couchcrew-thomas May 20, 2019
e57779c
added unit tests for timeout and bid won callbacks
couchcrew-thomas May 22, 2019
0af865c
updated bid request to FeedAd API
couchcrew-thomas Jun 3, 2019
4d21899
added parsing of feedad api bid response
couchcrew-thomas Jun 3, 2019
3185358
added transmisison of tracking events to FeedAd Api
couchcrew-thomas Jun 5, 2019
d7673e4
code cleanup
couchcrew-thomas Jun 7, 2019
79a3cbc
updated feedad unit tests for buildRequest method
couchcrew-thomas Jun 7, 2019
d446300
added unit tests for event tracking implementation
couchcrew-thomas Jun 7, 2019
766f23c
added unit test for interpretResponse method
couchcrew-thomas Jun 7, 2019
2d469c0
added adapter documentation
couchcrew-thomas Jun 7, 2019
138d1ff
added dedicated feedad example page
couchcrew-thomas Jun 7, 2019
e4c7214
updated feedad adapter to use live system
couchcrew-thomas Jun 7, 2019
0eabd34
updated FeedAd adapter placement ID regex
couchcrew-thomas Jun 10, 2019
1ff7caa
removed groups from FeedAd adapter placement ID regex
couchcrew-thomas Jun 11, 2019
748590e
removed dedicated feedad example page
couchcrew-thomas Jun 14, 2019
98e422a
updated imports in FeedAd adapter file to use relative paths
couchcrew-thomas Jun 14, 2019
f2836f3
updated FeedAd adapter unit test to use sinon.useFakeXMLHttpRequest()
couchcrew-thomas Jun 14, 2019
7e8b354
merged upstream
couchcrew-thomas Jun 4, 2020
d536db6
Merge remote-tracking branch 'upstream/master'
couchcrew-thomas Nov 13, 2020
0fd9ea2
Merge remote-tracking branch 'upstream/master'
couchcrew-thomas Apr 6, 2021
d9f9124
added GDPR fields to the FeedAd bid request
couchcrew-thomas Apr 7, 2021
19456aa
removed video from supported media types of the FeedAd adapter
couchcrew-thomas Apr 7, 2021
3ed8246
increased version code of FeedAd adapter to 1.0.2
couchcrew-thomas Apr 7, 2021
b8f178c
removed unnecessary check of bidder request
couchcrew-thomas Apr 7, 2021
67014fd
fixed unit test testing for old FeedAd version
couchcrew-thomas Apr 7, 2021
e7e7dff
removed video media type example from documentation file
couchcrew-thomas Apr 7, 2021
c8242fb
added gvlid to FeedAd adapter
couchcrew-thomas Apr 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions modules/feedadBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {BANNER} from '../src/mediaTypes.js';
import {ajax} from '../src/ajax.js';

/**
* Version of the FeedAd bid adapter
* @type {string}
*/
const VERSION = '1.0.0';
const VERSION = '1.0.2';

/**
* @typedef {object} FeedAdApiBidRequest
Expand Down Expand Up @@ -71,7 +71,7 @@ const BIDDER_CODE = 'feedad';
* The media types supported by FeedAd
* @type {MediaType[]}
*/
const MEDIA_TYPES = [VIDEO, BANNER];
const MEDIA_TYPES = [BANNER];

/**
* Tag for logging
Expand Down Expand Up @@ -204,6 +204,10 @@ function buildRequests(validBidRequests, bidderRequest) {
referer: data.refererInfo.referer,
transactionId: bid.transactionId
});
if (bidderRequest.gdprConsent) {
data.consentIabTcf = bidderRequest.gdprConsent.consentString;
data.gdprApplies = bidderRequest.gdprConsent.gdprApplies;
}
return {
method: 'POST',
url: `${API_ENDPOINT}${API_PATH_BID_REQUEST}`,
Expand Down
3 changes: 0 additions & 3 deletions modules/feedadBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ Prebid.JS adapter that connects to the FeedAd demand sources.
mediaTypes: {
banner: { // supports all banner sizes
sizes: [[300, 250]],
},
video: { // supports only outstream video
context: 'outstream'
}
},
bids: [
Expand Down
38 changes: 36 additions & 2 deletions test/spec/modules/feedadBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('FeedAdAdapter', function () {
it('should only support video and banner ads', function () {
expect(spec.supportedMediaTypes).to.be.a('array');
expect(spec.supportedMediaTypes).to.include(BANNER);
expect(spec.supportedMediaTypes).to.include(VIDEO);
expect(spec.supportedMediaTypes).not.to.include(VIDEO);
expect(spec.supportedMediaTypes).not.to.include(NATIVE);
});
it('should export the BidderSpec functions', function () {
Expand Down Expand Up @@ -248,6 +248,40 @@ describe('FeedAdAdapter', function () {
let result = spec.buildRequests([bid, bid, bid]);
expect(result).to.be.empty;
});
it('should not include GDPR data if the bidder request has none available', function () {
let bid = {
code: 'feedad',
mediaTypes: {
banner: {
sizes: [[320, 250]]
}
},
params: {clientToken: 'clientToken', placementId: 'placement-id'}
};
let result = spec.buildRequests([bid], bidderRequest);
expect(result.data.gdprApplies).to.be.undefined;
expect(result.data.consentIabTcf).to.be.undefined;
});
it('should include GDPR data if the bidder requests contains it', function () {
let bid = {
code: 'feedad',
mediaTypes: {
banner: {
sizes: [[320, 250]]
}
},
params: {clientToken: 'clientToken', placementId: 'placement-id'}
};
let request = Object.assign({}, bidderRequest, {
gdprConsent: {
consentString: 'the consent string',
gdprApplies: true
}
});
let result = spec.buildRequests([bid], request);
expect(result.data.gdprApplies).to.equal(request.gdprConsent.gdprApplies);
expect(result.data.consentIabTcf).to.equal(request.gdprConsent.consentString);
});
});

describe('interpretResponse', function () {
Expand Down Expand Up @@ -404,7 +438,7 @@ describe('FeedAdAdapter', function () {
prebid_bid_id: bidId,
prebid_transaction_id: transactionId,
referer,
sdk_version: '1.0.0'
sdk_version: '1.0.2'
};
subject(data);
expect(server.requests.length).to.equal(1);
Expand Down