Skip to content

Commit

Permalink
TheMediaGrid Bid Adapter: Coppa support (#6655)
Browse files Browse the repository at this point in the history
* Added TheMediaGridNM Bid Adapter

* Updated required params for TheMediaGridNM Bid Adapter

* Update TheMediGridNM Bid Adapter

* Fix tests for TheMediaGridNM Bid Adapter

* Fixes after review for TheMediaGridNM Bid Adapter

* Add support of multi-format in TheMediaGrid Bid Adapter

* Update sync url for grid and gridNM Bid Adapters

* TheMediaGrid Bid Adapter: added keywords adUnit parameter

* Update TheMediaGrid Bid Adapter to support keywords from config

* Implement new request format for TheMediaGrid Bid Adapter

* Fix jwpseg params for TheMediaGrid Bid Adapter

* Update unit tests for The Media Grid Bid Adapter

* Fix typo in TheMediaGrid Bid Adapter

* Added test for jwTargeting in TheMediaGrid Bid Adapter

* The new request format was made by default in TheMediaGrid Bid Adapter

* Update userId format in ad request for TheMediaGrid Bid Adapter

* Added bidFloor parameter for TheMediaGrid Bid Adapter

* Fix for review TheMediaGrid Bid Adapter

* Support floorModule in TheMediaGrid Bid Adapter

* Fix empty bidfloor for TheMediaGrid Bid Adapter

* Some change to restart autotests

* Fix userIds format for TheMediaGrid Bid Adapter

* Remove digitrust userId from TheMediaGrid Bid Adapter

* Protocols was added in video section in ad request for TheMediaGrid Bid Adapter

* TheMediaGrid: fix trouble with alias using

* TheMediaGridNM: fix trouble with alias

* TheMediaGrid Bid Adapter: added support of PBAdSlot module

* TheMediaGrid Bid Adapter: fix typo

* TheMediaGrid Bid Adapter: support coppa
  • Loading branch information
TheMediaGrid authored Apr 28, 2021
1 parent e5f9f57 commit 09dcc38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/gridBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { Renderer } from '../src/Renderer.js';
import { VIDEO, BANNER } from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import { config } from '../src/config.js';

const BIDDER_CODE = 'grid';
const ENDPOINT_URL = 'https://grid.bidswitch.net/hbjson';
Expand Down Expand Up @@ -219,6 +219,13 @@ export const spec = {
request.regs.ext.us_privacy = uspConsent;
}

if (config.getConfig('coppa') === true) {
if (!request.regs) {
request.regs = {};
}
request.regs.coppa = 1;
}

return {
method: 'POST',
url: ENDPOINT_URL,
Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/gridBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,16 @@ describe('TheMediaGrid Adapter', function () {
expect(payload.tmax).to.equal(3000);
getConfigStub.restore();
});
it('should contain regs.coppa if coppa is true in config', function () {
const getConfigStub = sinon.stub(config, 'getConfig').callsFake(
arg => arg === 'coppa' ? true : null);
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('regs');
expect(payload.regs).to.have.property('coppa', 1);
getConfigStub.restore();
});
it('should contain imp[].ext.data.adserver if available', function() {
const ortb2Imp = [{
ext: {
Expand Down

0 comments on commit 09dcc38

Please sign in to comment.