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

Ras Bid Adapter: update ras adapter and rename it to ringieraxelspringer #11657

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { getAllOrtbKeywords } from '../libraries/keywords/keywords.js';
import { getAdUnitSizes } from '../libraries/sizeUtils/sizeUtils.js';

const BIDDER_CODE = 'ras';
const BIDDER_CODE = 'ringieraxelspringer';
const VERSION = '1.0';

const getEndpoint = (network) => {
Expand Down Expand Up @@ -106,38 +106,66 @@ function parseOrtbResponse(ad) {
return false;
}

const { image, Image, title, url, Headline, Thirdpartyclicktracker, imp, impression, impression1, impressionJs1 } = ad.data.fields;
const { image, Image, title, url, Headline, Thirdpartyclicktracker, thirdPartyClickTracker2, imp, impression, impression1, impressionJs1, partner_logo: partnerLogo, adInfo, body } = ad.data.fields;
const { dsaurl, height, width, adclick } = ad.data.meta;
const emsLink = ad.ems_link;
const link = adclick + (url || Thirdpartyclicktracker);
const eventtrackers = prepareEventtrackers(emsLink, imp, impression, impression1, impressionJs1);
const clicktrackers = thirdPartyClickTracker2 ? [thirdPartyClickTracker2] : [];

const ortb = {
ver: '1.2',
assets: [
{
id: 2,
id: 0,
data: {
value: body || '',
type: 2
},
},
{
id: 1,
data: {
value: adInfo || '',
// Body2 type
type: 10
},
},
{
id: 3,
img: {
url: image || Image || '',
type: 1,
url: partnerLogo || '',
w: width,
h: height
}
},
{
id: 4,
title: {
text: title || Headline || ''
img: {
type: 3,
url: image || Image || '',
w: width,
h: height
}
},
{
id: 3,
id: 5,
data: {
value: deepAccess(ad, 'data.meta.advertiser_name', null),
type: 1
}
}
},
{
id: 6,
title: {
text: title || Headline || ''
}
},
],
link: {
url: link
url: link,
clicktrackers
},
eventtrackers
};
Expand All @@ -154,7 +182,7 @@ function parseNativeResponse(ad) {
return false;
}

const { image, Image, title, leadtext, url, Calltoaction, Body, Headline, Thirdpartyclicktracker } = ad.data.fields;
const { image, Image, title, leadtext, url, Calltoaction, Body, Headline, Thirdpartyclicktracker, adInfo, partner_logo: partnerLogo } = ad.data.fields;
const { dsaurl, height, width, adclick } = ad.data.meta;
const link = adclick + (url || Thirdpartyclicktracker);
const nativeResponse = {
Expand All @@ -165,10 +193,15 @@ function parseNativeResponse(ad) {
width,
height
},

icon: {
url: partnerLogo || '',
width,
height
},
clickUrl: link,
cta: Calltoaction || '',
body: leadtext || Body || '',
body2: adInfo || '',
sponsoredBy: deepAccess(ad, 'data.meta.advertiser_name', null) || '',
ortb: parseOrtbResponse(ad)
};
Expand All @@ -192,7 +225,7 @@ const buildBid = (ad, mediaType) => {
creativeId: ad.adid ? parseInt(ad.adid.split(',')[2], 10) : 0,
netRevenue: true,
currency: ad.currency || 'USD',
dealId: null,
dealId: ad.prebid_deal || null,
actgMatch: ad.actg_match || 0,
meta: { mediaType: BANNER },
mediaType: BANNER,
Expand Down Expand Up @@ -243,6 +276,8 @@ const getSlots = (bidRequests) => {
queryString += `&cre_format${i}=native`;
}

queryString += `&kvhb_format${i}=${creFormat === 'native' ? 'native' : 'banner'}`;

if (sizes) {
queryString += `&iusizes${i}=${encodeURIComponent(sizes)}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var adUnits = [{
}
},
bids: [{
bidder: 'ras',
bidder: 'ringieraxelspringer',
params: {
network: '4178463',
site: 'test',
Expand All @@ -36,11 +36,11 @@ var adUnits = [{

| Name | Scope | Type | Description | Example |
|------------------------------|----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| network | required | String | Specific identifier provided by RAS | `"4178463"` |
| site | required | String | Specific identifier name (case-insensitive) that is associated with this ad unit and provided by RAS | `"example_com"` |
| network | required | String | Specific identifier provided by Ringier Axel Springer | `"4178463"` |
| site | required | String | Specific identifier name (case-insensitive) that is associated with this ad unit and provided by Ringier Axel Springer | `"example_com"` |
| area | required | String | Ad unit category name; only case-insensitive alphanumeric with underscores and hyphens are allowed | `"sport"` |
| slot | required | String | Ad unit placement name (case-insensitive) provided by RAS | `"slot"` |
| slotSequence | optional | Number | Ad unit sequence position provided by RAS | `1` |
| slot | required | String | Ad unit placement name (case-insensitive) provided by Ringier Axel Springer | `"slot"` |
| slotSequence | optional | Number | Ad unit sequence position provided by Ringier Axel Springer | `1` |
| pageContext | optional | Object | Web page context data | `{}` |
| pageContext.dr | optional | String | Document referrer URL address | `"https://example.com/"` |
| pageContext.du | optional | String | Document URL address | `"https://example.com/sport/football/article.html?id=932016a5-02fc-4d5c-b643-fafc2f270f06"` |
Expand Down
Loading