Skip to content

Commit

Permalink
update AdGeneration adapter. (#3613)
Browse files Browse the repository at this point in the history
  • Loading branch information
banakemi authored and jaiminpanchal27 committed Mar 11, 2019
1 parent f25bc65 commit d00c92a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/adgenerationBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as utils from '../src/utils';
import {registerBidder} from '../src/adapters/bidderFactory';
import {BANNER, NATIVE} from '../src/mediaTypes';
import { config } from '../src/config';
import {config} from '../src/config';
const ADG_BIDDER_CODE = 'adgeneration';

export const spec = {
Expand Down Expand Up @@ -156,6 +156,9 @@ function createNativeAd(body) {
case 6:
native.cta = assets[i].data.value;
break;
case 502:
native.privacyLink = encodeURIComponent(assets[i].data.value);
break;
}
}
native.clickUrl = body.native_ad.link.url;
Expand Down
5 changes: 4 additions & 1 deletion modules/adgenerationBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ var adUnits = [
},
icon: {
required: true
}
},
privacyLink: {
required: true
},
},
},
bids: [
Expand Down
4 changes: 3 additions & 1 deletion test/spec/modules/adgenerationBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('AdgenerationAdapter', function () {
{
data: {
label: 'optout_url',
value: 'https://supership.jp/optout/'
value: 'https://supership.jp/optout/#'
},
id: 502
},
Expand Down Expand Up @@ -350,6 +350,7 @@ describe('AdgenerationAdapter', function () {
sponsoredBy: 'Sponsored',
body: 'Description',
cta: 'CTA',
privacyLink: 'https://supership.jp/optout/#',
clickUrl: 'https://supership.jp',
clickTrackers: ['https://s3-ap-northeast-1.amazonaws.com/adg-dummy-dsp/1x1_clicktracker_access.gif'],
impressionTrackers: ['https://s3-ap-northeast-1.amazonaws.com/adg-dummy-dsp/1x1.gif']
Expand Down Expand Up @@ -396,6 +397,7 @@ describe('AdgenerationAdapter', function () {
expect(result.native.sponsoredBy).to.equal(bidResponses.native.native.sponsoredBy);
expect(result.native.body).to.equal(bidResponses.native.native.body);
expect(result.native.cta).to.equal(bidResponses.native.native.cta);
expect(decodeURIComponent(result.native.privacyLink)).to.equal(bidResponses.native.native.privacyLink);
expect(result.native.clickUrl).to.equal(bidResponses.native.native.clickUrl);
expect(result.native.impressionTrackers[0]).to.equal(bidResponses.native.native.impressionTrackers[0]);
expect(result.native.clickTrackers[0]).to.equal(bidResponses.native.native.clickTrackers[0]);
Expand Down

0 comments on commit d00c92a

Please sign in to comment.