Skip to content

Commit d00c92a

Browse files
banakemijaiminpanchal27
authored andcommitted
update AdGeneration adapter. (prebid#3613)
1 parent f25bc65 commit d00c92a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

modules/adgenerationBidAdapter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as utils from '../src/utils';
22
import {registerBidder} from '../src/adapters/bidderFactory';
33
import {BANNER, NATIVE} from '../src/mediaTypes';
4-
import { config } from '../src/config';
4+
import {config} from '../src/config';
55
const ADG_BIDDER_CODE = 'adgeneration';
66

77
export const spec = {
@@ -156,6 +156,9 @@ function createNativeAd(body) {
156156
case 6:
157157
native.cta = assets[i].data.value;
158158
break;
159+
case 502:
160+
native.privacyLink = encodeURIComponent(assets[i].data.value);
161+
break;
159162
}
160163
}
161164
native.clickUrl = body.native_ad.link.url;

modules/adgenerationBidAdapter.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ var adUnits = [
5252
},
5353
icon: {
5454
required: true
55-
}
55+
},
56+
privacyLink: {
57+
required: true
58+
},
5659
},
5760
},
5861
bids: [

test/spec/modules/adgenerationBidAdapter_spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ describe('AdgenerationAdapter', function () {
238238
{
239239
data: {
240240
label: 'optout_url',
241-
value: 'https://supership.jp/optout/'
241+
value: 'https://supership.jp/optout/#'
242242
},
243243
id: 502
244244
},
@@ -350,6 +350,7 @@ describe('AdgenerationAdapter', function () {
350350
sponsoredBy: 'Sponsored',
351351
body: 'Description',
352352
cta: 'CTA',
353+
privacyLink: 'https://supership.jp/optout/#',
353354
clickUrl: 'https://supership.jp',
354355
clickTrackers: ['https://s3-ap-northeast-1.amazonaws.com/adg-dummy-dsp/1x1_clicktracker_access.gif'],
355356
impressionTrackers: ['https://s3-ap-northeast-1.amazonaws.com/adg-dummy-dsp/1x1.gif']
@@ -396,6 +397,7 @@ describe('AdgenerationAdapter', function () {
396397
expect(result.native.sponsoredBy).to.equal(bidResponses.native.native.sponsoredBy);
397398
expect(result.native.body).to.equal(bidResponses.native.native.body);
398399
expect(result.native.cta).to.equal(bidResponses.native.native.cta);
400+
expect(decodeURIComponent(result.native.privacyLink)).to.equal(bidResponses.native.native.privacyLink);
399401
expect(result.native.clickUrl).to.equal(bidResponses.native.native.clickUrl);
400402
expect(result.native.impressionTrackers[0]).to.equal(bidResponses.native.native.impressionTrackers[0]);
401403
expect(result.native.clickTrackers[0]).to.equal(bidResponses.native.native.clickTrackers[0]);

0 commit comments

Comments
 (0)