Skip to content

Commit

Permalink
Merge pull request #58 from AntoineJac/master
Browse files Browse the repository at this point in the history
HTP-Rubicon: New Version 2.1.4
  • Loading branch information
ix-certification committed Sep 10, 2019
2 parents 14ee40e + 2c9ccb2 commit 7dcc438
Show file tree
Hide file tree
Showing 7 changed files with 1,504 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions rubicon/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 2.1.4

- Testing file:
the test file has been added with 8 tests and 8 success (system-tester.html).
npm run debug and reach /system-tester.html
result: 8 specs, 0 failures

- ESLint:
Adapter file has been cleaned and succesfuly pass:
npm run lint

- Adapter changes:
Some edit to change the rubicon key (hb_pb_ixrubicon) for reporting only.
The ad is still correctly displayed on both the safeFrame and no safeFrame slots
2 sizes have been added to the sizeToSizeIdMapping

# 2.1.3

Previous version used.

69 changes: 69 additions & 0 deletions rubicon/DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Rubicon
## General Compatibility
|Feature| |
|---|---|
| Consent | |
| Native Ad Support | |
| SafeFrame Support | |
| PMP Support | |

## Browser Compatibility
| Browser | |
|--- |---|
| Chrome | |
| Edge | |
| Firefox | |
| Internet Explorer 9 | |
| Internet Explorer 10 | |
| Internet Explorer 11 | |
| Safari | |
| Mobile Chrome | |
| Mobile Safari | |
| UC Browser | |
| Samsung Internet | |
| Opera | |

## Adapter Information
| Info | |
|---|---|
| Partner Id | RubiconHtb |
| Ad Server Responds in (Cents, Dollars, etc) | |
| Bid Type (Gross / Net) | |
| GAM Key (Open Market) | |
| GAM Key (Private Market) | |
| Ad Server URLs | |
| Slot Mapping Style (Size / Multiple Sizes / Slot) | |
| Request Architecture (MRA / SRA) | |

## Currencies Supported

## Bid Request Information
### Parameters
| Key | Required | Type | Description |
|---|---|---|---|
| | | | |

### Example
```javascript

```

## Bid Response Information
### Bid Example
```javascript

```
### Pass Example
```javascript

```

## Configuration Information
### Configuration Keys
| Key | Required | Type | Description |
|---|---|---|---|
| | | | |
### Example
```javascript

```
10 changes: 10 additions & 0 deletions rubicon/rubicon-htb-exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//? if (FEATURES.GPT_LINE_ITEMS) {
shellInterface.RubiconHtb = {
render: SpaceCamp.services.RenderService.renderDfpAd.bind(null, 'RubiconHtb')
};

//? if (FEATURES.RUBICON_LINE_ITEMS) {
window.top.rubicontag = window.top.rubicontag || {};
window.top.rubicontag.renderCreative = SpaceCamp.services.RenderService.renderRubiconAd.bind(null, 'RubiconHtb');
//? }
//? }
193 changes: 193 additions & 0 deletions rubicon/rubicon-htb-system-tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
'use strict';

function getPartnerId() {
return 'RubiconHtb';
}

function getBidRequestRegex() {
return {
method: 'GET',
urlRegex: /.*fastlane\.rubiconproject\.com\/a\/api\/fastlane.json.*/
};
}

function getCallbackType() {
return 'NONE';
}

function getArchitecture() {
return 'MRA';
}

function getStatsId() {
return 'RUBI';
}

function validateBidRequest(request) {
var r = request.query;

expect(r.account_id).toBe('1234');

expect(r.site_id).toBe('112233');

expect(r.zone_id).toBe('556677');

expect(r.size_id).toBe('15');

expect(r.alt_size_ids).toBe('10');

expect(r.rf).toEqual(jasmine.anything());
}

function validateBidRequestWithPrivacy(request) {
var r = request.query;

expect(r.gdpr).toBe('1');

expect(r.gdpr_consent).toBe('TEST_GDPR_CONSENT_STRING');
}

function getConfig() {
return {
accountId: '1234',
xSlots: {
1: {
siteId: '112233',
zoneId: '556677',
sizes: [[300, 250], [300, 600]]
}
}
};
}

function getValidResponse(request, creative) {
var adm = '</script>' + creative + '<script>';
var response = {
status: 'ok',
account_id: 1234,
site_id: 112233,
zone_id: 556677,
size_id: 15,
tracking: '',
inventory: {
},
ads: [
{
status: 'ok',
impression_id: '1234test-1234-12q1-12e4-c08098test',
size_id: '15',
ad_id: '6789',
advertiser: 5678,
network: 1902,
creative_id: '1902:12345',
type: 'script',
script: adm,
campaign_id: 48985,
rtb_rule_id: 1598010,
cpm: 2,
targeting: [
{
key: 'rpfl_1234',
values: ['15_tier00015']
}
]
}
]
};

return JSON.stringify(response);
}

function validateTargeting(targetingMap) {
expect(targetingMap).toEqual(jasmine.objectContaining({
ix_rubi_om: jasmine.arrayContaining(['300x250_200']),
ix_rubi_id: jasmine.arrayContaining([jasmine.any(String)])
}));
}

function getPassResponse() {
var skipResponse = {
status: 'ok',
account_id: 1234,
site_id: 112233,
zone_id: 556677,
size_id: 15,
alt_size_ids: [10],
tracking: '',
inventory: {
},
ads: [
{
status: 'no-ads',
reason: 'floor-not-met',
error_code: '10',
impression_id: '1234test-1234-12q1-12e4-c08098test'
}
]
};

return JSON.stringify(skipResponse);
}

function getValidResponseWithDeal(request, creative) {
var adm = '</script>' + creative + '<script>';
var response = {
status: 'ok',
account_id: 1234,
site_id: 112233,
zone_id: 556677,
size_id: 15,
tracking: '',
inventory: {
},
ads: [
{
status: 'ok',
impression_id: '1234test-1234-12q1-12e4-c08098test',
size_id: '15',
ad_id: '6789',
advertiser: 5678,
network: 1902,
creative_id: '1902:12345',
type: 'script',
script: adm,
campaign_id: 48985,
rtb_rule_id: 1598010,
cpm: 2,
deal: 12345,
targeting: [
{
key: 'rpfl_1234',
values: ['deal_tierAll']
}
]
}
]
};

return JSON.stringify(response);
}

function validateTargetingWithDeal(targetingMap) {
expect(targetingMap).toEqual(jasmine.objectContaining({
ix_rubi_om: jasmine.arrayContaining(['300x250_200']),
ix_rubi_id: jasmine.arrayContaining([jasmine.any(String)]),
rpfl_1234: jasmine.arrayContaining(['deal_tierAll'])
}));
}

module.exports = {
getPartnerId: getPartnerId,
getBidRequestRegex: getBidRequestRegex,
getCallbackType: getCallbackType,
getConfig: getConfig,
getArchitecture: getArchitecture,
getStatsId: getStatsId,
validateBidRequest: validateBidRequest,
validateBidRequestWithPrivacy: validateBidRequestWithPrivacy,
getValidResponse: getValidResponse,
validateTargeting: validateTargeting,
getPassResponse: getPassResponse,
getValidResponseWithDeal: getValidResponseWithDeal,
validateTargetingWithDeal: validateTargetingWithDeal
};

0 comments on commit 7dcc438

Please sign in to comment.