From d00c92afde2e9503208e76029cb5e2428b9ce0ab Mon Sep 17 00:00:00 2001 From: "Takaaki.Kojima" Date: Tue, 12 Mar 2019 00:57:36 +0900 Subject: [PATCH] update AdGeneration adapter. (#3613) --- modules/adgenerationBidAdapter.js | 5 ++++- modules/adgenerationBidAdapter.md | 5 ++++- test/spec/modules/adgenerationBidAdapter_spec.js | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/adgenerationBidAdapter.js b/modules/adgenerationBidAdapter.js index 1e00485a6d9..77b6acbf0e0 100644 --- a/modules/adgenerationBidAdapter.js +++ b/modules/adgenerationBidAdapter.js @@ -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 = { @@ -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; diff --git a/modules/adgenerationBidAdapter.md b/modules/adgenerationBidAdapter.md index 7d8281be9b2..7dfc301e657 100644 --- a/modules/adgenerationBidAdapter.md +++ b/modules/adgenerationBidAdapter.md @@ -52,7 +52,10 @@ var adUnits = [ }, icon: { required: true - } + }, + privacyLink: { + required: true + }, }, }, bids: [ diff --git a/test/spec/modules/adgenerationBidAdapter_spec.js b/test/spec/modules/adgenerationBidAdapter_spec.js index a2c8125850a..28bccd7844e 100644 --- a/test/spec/modules/adgenerationBidAdapter_spec.js +++ b/test/spec/modules/adgenerationBidAdapter_spec.js @@ -238,7 +238,7 @@ describe('AdgenerationAdapter', function () { { data: { label: 'optout_url', - value: 'https://supership.jp/optout/' + value: 'https://supership.jp/optout/#' }, id: 502 }, @@ -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'] @@ -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]);