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

Gnet Bid Adapter: Change endpoint and add parameter #7934

Merged
merged 12 commits into from
Jan 13, 2022
6 changes: 3 additions & 3 deletions modules/gnetBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { _each, parseSizesInput, isEmpty } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { _each, isEmpty, parseSizesInput } from '../src/utils.js';
import { BANNER } from '../src/mediaTypes.js';

const BIDDER_CODE = 'gnet';
const ENDPOINT = 'https://adserver.gnetproject.com/prebid.php';
const ENDPOINT = 'https://service.gnetrtb.com/api/adrequest';

export const spec = {
code: BIDDER_CODE,
Expand All @@ -16,7 +16,7 @@ export const spec = {
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
return !!(bid.params.websiteId);
return !!(bid.params.websiteId && bid.params.adunitId);
},

/**
Expand Down
8 changes: 4 additions & 4 deletions modules/gnetBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Overview

```
Module Name: Gnet Bidder Adapter
Module Name: Gnet RTB Bidder Adapter
Module Type: Bidder Adapter
Maintainer: roberto.wu@grumft.com
Maintainer: bruno.bonanho@grumft.com
```

# Description

Connect to Gnet Project exchange for bids.
Connect to Gnet RTB exchange for bids.

# Test Parameters
```
Expand All @@ -24,7 +24,7 @@ Connect to Gnet Project exchange for bids.
{
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
}
}
]
Expand Down
12 changes: 6 additions & 6 deletions test/spec/modules/gnetBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
newBidder
} from 'src/adapters/bidderFactory.js';

const ENDPOINT = 'https://adserver.gnetproject.com/prebid.php';
const ENDPOINT = 'https://service.gnetrtb.com/api/adrequest';

describe('gnetAdapter', function () {
const adapter = newBidder(spec);
Expand All @@ -23,7 +23,7 @@ describe('gnetAdapter', function () {
let bid = {
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
}
};

Expand All @@ -43,7 +43,7 @@ describe('gnetAdapter', function () {
const bidRequests = [{
bidder: 'gnet',
params: {
websiteId: '4'
websiteId: '1', adunitId: '1'
},
adUnitCode: '/150790500/4_ZONA_IAB_300x250_5',
sizes: [
Expand All @@ -57,7 +57,7 @@ describe('gnetAdapter', function () {

const bidderRequest = {
refererInfo: {
referer: 'https://gnetproject.com/'
referer: 'https://gnetrtb.com'
}
};

Expand All @@ -66,13 +66,13 @@ describe('gnetAdapter', function () {
expect(requests[0].url).to.equal(ENDPOINT);
expect(requests[0].method).to.equal('POST');
expect(requests[0].data).to.equal(JSON.stringify({
'referer': 'https://gnetproject.com/',
'referer': 'https://gnetrtb.com',
'adUnitCode': '/150790500/4_ZONA_IAB_300x250_5',
'bidId': '2a19afd5173318',
'transactionId': '894bdff6-61ec-4bec-a5a9-f36a5bfccef5',
'sizes': ['300x250'],
'params': {
'websiteId': '4'
'websiteId': '1', 'adunitId': '1'
}
}));
});
Expand Down