Skip to content

Commit

Permalink
Rvr 2005 rvr analytics adapter (#4)
Browse files Browse the repository at this point in the history
* Submitting EMX Digital Adapter (prebid#3173)

* Submitting EMX Digital Prebid Adapter

Submitting EMX Digital Prebid Adapter code

* fixing lint errors. updating our md

* updating to const/let variables. adding test spec.

* fixed linting on test spec js

* TheMediaGrid Bid Adapter (prebid#3204)

* Added Grid Bid Adapter

* remove priceType from TheMediaGrid Bid Adapter

* Adding user sync method for IFRAME and Pixel (prebid#3232)

* Submitting EMX Digital Prebid Adapter

Submitting EMX Digital Prebid Adapter code

* fixing lint errors. updating our md

* updating to const/let variables. adding test spec.

* fixed linting on test spec js

* adding emx usersync methods

* updates (prebid#3162)

* Only set native targeting if value exists. (prebid#3225)

* add nolint command line option, similar to notest (prebid#3234)

* add inskin iab vendor id: enables consent via string (prebid#3235)

* Added user sync support for undertone bid adapter (prebid#3172)

* Added user sync support for undertone bid adapter (new pull request)

* Added user sync support for undertone bid adapter

* fix indentation

* Changed utils.getWindowTop() with the newer prebid utilities

* Updating Auction Init Pick for timestamp + Test update (prebid#3223)

* Updating Auction Init Pick for timestamp + Test update

* Updating Auction Init to include  once again + Rubicon Analytics update accordingly

* Removing  from auction init events in favor of old

* Add code, test, and doc for Adikteev adapter (prebid#3229)

* Add code, test, and doc for Adikteev adapter

* Reflect comments on other PR

http://prebid.org/dev-docs/bidder-adaptor.html#referrers
prebid#3230 (comment)

* 'currency' isn't a bidder-specific param

Update PR following this remark on another one:
prebid#3228 (comment)

* Add integration example, fix bid requestId

* Quantcast adapter onTimeout (prebid#3239)

* onTimeout WIP

* test for onTimeout

* some renaming

* cleanup

* cleanup

* trying to fix the test

* using ajax instead of fetch

* Test cleanup (prebid#3238)

* stub pixel call in justpremium tests

* properly stub geolocation services to prevent prompts

* stub img creation as well to prevent call in justpremium

* Appnexus adapter: Added dealPriority and dealCode to bidResponse (prebid#3201)

* Added dealPriority and dealCode to appnexus adapter

* update failed test

* added namespace and did deep merge

* keep all properties together

* use unit id being sent instead of hard coded auid (prebid#3236)

* use unit id being sent instead of hard coded auid

* make multiple requests

* removes commented out code. adds aus param back

* Prebid 1.30.0 Release

* increment pre version

* fix deal targeting for cpm 0 (prebid#3233)

* YIELDONE adapter - support Video (prebid#3227)

* added UserSync

* added UserSync Unit Test

* support for multi sizes

* register the adapter as supporting video

* supporting video

* change requestId acquisition method

* fix the parameter name of dealID

* update test parameters

* support instream video

* add test for bidRequest

* add test for interpretResponse

* add test params

* add note to documentaion

* clarifying the multi-format support message

* rtbhouseBidAdapter changes (prebid#3241)

* Add transactionId support

* Change site getting method

* Add bidfloor param

* correct user agent value population (prebid#3248)

* RVR-1124 Setup initial skeleton analytics adapter that can send something.

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Formatted auction/events data to fit needed schema.

* RVR-1135 fetched device data.

* Applied feedback.

* Applied feedback.

* Fetched core.

* Added click handler for reporting banners click events.

* Applied analyzer for reporting displayed impressions.

* Applied feedback.

* Merged in RVR-1214-invoke-handlers-on-rendering (pull request #7)

RVR-1214 Invoke handlers on rendering

* RVR-1214 Invoked handlers right after ad is displayed.

* Applied feedback.

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Merged in RVR-1192-configuration-global-parameters (pull request #8)

RVR-1192 Configuration/Global parameters

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Merged in RVR-1181-Prebid-js-unit-tests-setup (pull request #6)

RVR-1181 Prebid.js Unit tests setup

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Merged in RVR-1247-additional-data-to-impression-records (pull request #9)

RVR-1247 Additional data to impression records

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Merged in RVR-1249-add-requestedbids-to-auction (pull request #10)

RVR-1249 Add requested bids to auction object request.

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Merged in RVR-1261-fix-tests (pull request prebid#11)

RVR-1261 fix tests

* RVR-1261 Secured adapter from no containers configuration. And changed fetching URL.

* RVR-1261 Added event check for request and changed some names.

* Applied feedback.

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* RVR-1352 analytics adapter bugs

Approved-by: Alessandro Di Giovanni <alessandro.digiovanni@gamegenetics.de>

* Fixed bug with geolocation notification.

* fixed missing bracket.

* one more fix.

* RVR-1357 Different optimisation responses & tracking into auction event

* RVR-1852 - Add content type and hardcoded auth headers

(cherry picked from commit 4def881)

* RVR-1852 - Change tracker host

* RVR-1852 - Override content type instead of adding header

* RVR-1914 Consistent data types in events

Also removes undefined and null properties in audience events

* Merged in RVR-1883-Add-Basic-Access-Authentication (pull request prebid#17)

RVR-1883 Add Basic Access Authentication

* RVR-1914 - Rename functions

* RVR-1914 - Set default total_duration to null in bid response

* RVR-1883 - Use RIVR_CLIENT_AUTH_TOKEN global variable for Auth token

* RVR-1883 - Restore stub after every test not just at the end

* RVR-1883 - Remove commented code

* Increase code coverage

* Fix for IE 11.0.0 and Safari 8.0.8 - includes()

Use core-js includes function for array

* Restore pbjs_api_spec.js

* Fix API calls for rivr analytics impressions and clicks

* RVR-2005 - Change auction object model

* RVR-2005 - Set rvr_usr_id cookie

* RVR-2005 - Remove BID_REQUESTED and BID_RESPONSE handlers

We have the same infos all collected in AUCTION_END

* RVR-2005 - build Bidders Array From Auction End

* RVR-2005 - build impressions Array From Auction End

* RVR-2005 - set status of winning bid

* RVR-2005 - cleanup

* RVR-2005 - adapt enableAnalytics() test

* RVR-2005 - adapt all tests

* RVR-2005 - Add Rivr Analytics adapter md file

* RVR-2005 - rewrite connectAllUnits

* RVR-2005 - correct typo

* RVR-2005 - use IE compatible find()
  • Loading branch information
AlessandroDG authored Nov 2, 2018
1 parent a9dfc04 commit 059a38b
Show file tree
Hide file tree
Showing 43 changed files with 2,766 additions and 582 deletions.
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ function escapePostbidConfig() {
};
escapePostbidConfig.displayName = 'escape-postbid-config';

function lint() {
function lint(done) {
if (argv.nolint) {
return done();
}
return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'])
.pipe(eslint())
.pipe(eslint.format('stylish'))
Expand Down
93 changes: 93 additions & 0 deletions integrationExamples/gpt/hello_world_adikteev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<html>

<head>
<link rel="icon" type="image/png" href="/favicon.png">
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var sizes = [
[300, 250],
[250, 300],
[300, 600]
];
var PREBID_TIMEOUT = 3000;
var FAILSAFE_TIMEOUT = 3000;

var adUnits = [{
code: '/19968336/header-bid-tag-1',
mediaTypes: {
banner: {
sizes: sizes
}
},
bids: [{
bidder: 'adikteev',
params: {
placementId: 13144370,
stagingEnvironment: true,
bidFloorPrice: 0.1,
}
}]
}];

// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
timeout: PREBID_TIMEOUT
});
});

function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}


// in case PBJS doesn't load
setTimeout(function () {
console.log("prebid.js setTimeout");
initAdserver();
}, FAILSAFE_TIMEOUT);

googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-1', sizes, 'div-1')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

</script>

</head>

<body>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<div id='div-1'>
<script type='text/javascript'>
googletag.cmd.push(function () {
googletag.display('div-1');
});

</script>
</div>
</body>

</html>
11 changes: 9 additions & 2 deletions integrationExamples/gpt/pbjs_example_gpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,15 @@
width: '300',
height: '250',
}
}

},
{
bidder: 'adikteev',
params: {
placementId: 12345,
currency: 'EUR',
bidFloorPrice: 0.1,
}
},
]
}, {
code: 'div-gpt-ad-12345678-1',
Expand Down
94 changes: 94 additions & 0 deletions modules/adikteevBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import {registerBidder} from 'src/adapters/bidderFactory';
import {BANNER} from 'src/mediaTypes';
import * as utils from '../src/utils';
import {config} from 'src/config';

export const BIDDER_CODE = 'adikteev';
export const ENDPOINT_URL = 'https://serve-adserver.adikteev.com/api/prebid/bid';
export const ENDPOINT_URL_STAGING = 'https://serve-adserver-staging.adikteev.com/api/prebid/bid';
export const USER_SYNC_IFRAME_URL = 'https://serve-adserver.adikteev.com/api/prebid/sync-iframe';
export const USER_SYNC_IFRAME_URL_STAGING = 'https://serve-adserver-staging.adikteev.com/api/prebid/sync-iframe';
export const USER_SYNC_IMAGE_URL = 'https://serve-adserver.adikteev.com/api/prebid/sync-image';
export const USER_SYNC_IMAGE_URL_STAGING = 'https://serve-adserver-staging.adikteev.com/api/prebid/sync-image';

export let stagingEnvironmentSwitch = false; // Don't use it. Allow us to make tests on staging

export function setstagingEnvironmentSwitch(value) {
stagingEnvironmentSwitch = value;
}

function validateSizes(sizes) {
if (!utils.isArray(sizes) || typeof sizes[0] === 'undefined') {
return false;
}
return sizes.every(size => utils.isArray(size) && size.length === 2);
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER],

isBidRequestValid: (bid) => {
setstagingEnvironmentSwitch(stagingEnvironmentSwitch || !!bid.params.stagingEnvironment);
return !!(
bid &&
bid.params &&
bid.params.bidFloorPrice &&
bid.params.placementId &&
bid.bidder === BIDDER_CODE &&
validateSizes(bid.mediaTypes.banner.sizes)
);
},

buildRequests: (validBidRequests, bidderRequest) => {
const payload = {
validBidRequests,
bidderRequest,
refererInfo: bidderRequest.refererInfo,
currency: config.getConfig('currency'),
userAgent: navigator.userAgent,
screen: {
width: window.screen.width,
height: window.screen.height
},
language: navigator.language,
cookies: document.cookie.split(';'),
prebidUpdateVersion: '1.29.0',
};
return {
method: 'POST',
url: stagingEnvironmentSwitch ? ENDPOINT_URL_STAGING : ENDPOINT_URL,
data: JSON.stringify(payload),
};
},

interpretResponse: (serverResponse, bidRequests) => {
const returnedBids = [];
const validBidRequests = JSON.parse(bidRequests.data).validBidRequests;
serverResponse.body.forEach((value, index) => {
const overrides = {
requestId: validBidRequests[index].bidId,
};
returnedBids.push(Object.assign({}, value, overrides));
});
return returnedBids;
},

getUserSyncs: (syncOptions, serverResponses) => {
const syncs = [];
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: stagingEnvironmentSwitch ? USER_SYNC_IFRAME_URL_STAGING : USER_SYNC_IFRAME_URL,
});
}
if (syncOptions.pixelEnabled && serverResponses.length > 0) {
syncs.push({
type: 'image',
url: stagingEnvironmentSwitch ? USER_SYNC_IMAGE_URL_STAGING : USER_SYNC_IMAGE_URL,
});
}
return syncs;
},
};
registerBidder(spec);
35 changes: 35 additions & 0 deletions modules/adikteevBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Overview

```
Module Name: Adikteev Bidder Adapter
Module Type: Bidder Adapter
Maintainer: adnetwork@adikteev.com
```

# Description

Module that connects to Adikteev's demand sources

# Test Parameters

``` javascript
var adUnits = [
{
code: 'test-div',
mediaTypes: {
banner: {
sizes: [[750, 200]], // a display size
}
},
bids: [
{
bidder: 'adikteev',
params: {
placementId: 12345,
bidFloorPrice: 0.1,
}
}
]
}
];
```
4 changes: 3 additions & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ function newBid(serverBid, rtbBid, bidderRequest) {
netRevenue: true,
ttl: 300,
appnexus: {
buyerMemberId: rtbBid.buyer_member_id
buyerMemberId: rtbBid.buyer_member_id,
dealPriority: rtbBid.deal_priority,
dealCode: rtbBid.deal_code
}
};

Expand Down
124 changes: 124 additions & 0 deletions modules/emx_digitalBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import * as utils from 'src/utils';
import {
registerBidder
} from 'src/adapters/bidderFactory';
import {
BANNER
} from 'src/mediaTypes';
import {
config
} from 'src/config';

const BIDDER_CODE = 'emx_digital';
const ENDPOINT = 'hb.emxdgt.com';
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER],
isBidRequestValid: function (bid) {
return !!(bid.params.tagid);
},
buildRequests: function (validBidRequests, bidRequests) {
const {host, href, protocol} = utils.getTopWindowLocation();
let emxData = {};
let emxImps = [];
const auctionId = bidRequests.auctionId;
const timeout = config.getConfig('bidderTimeout');
const timestamp = Date.now();
const url = location.protocol + '//' + ENDPOINT + ('?t=' + timeout + '&ts=' + timestamp);

utils._each(validBidRequests, function (bid) {
let tagId = String(utils.getBidIdParameter('tagid', bid.params));
let bidFloor = utils.getBidIdParameter('bidfloor', bid.params) || 0;
let emxBid = {
id: bid.bidId,
tid: bid.transactionId,
tagid: tagId,
secure: protocol === 'https:' ? 1 : 0,
banner: {
format: bid.sizes.map(function (size) {
return {
w: size[0],
h: size[1]
};
}),
w: bid.sizes[0][0],
h: bid.sizes[0][1]
}
}
if (bidFloor > 0) {
emxBid.bidfloor = bidFloor
}
emxImps.push(emxBid);
});
emxData = {
id: auctionId,
imp: emxImps,
site: {
domain: host,
page: href
}
};
if (bidRequests.gdprConsent) {
emxData.regs = {
ext: {
gdpr: bidRequests.gdprConsent.gdprApplies === true ? 1 : 0
}
};
}
if (bidRequests.gdprConsent && bidRequests.gdprConsent.gdprApplies) {
emxData.user = {
ext: {
consent: bidRequests.gdprConsent.consentString
}
};
}
return {
method: 'POST',
url: url,
data: JSON.stringify(emxData),
options: {
withCredentials: true
}
};
},
interpretResponse: function (serverResponse) {
let emxBidResponses = [];
let response = serverResponse.body || {};
if (response.seatbid && response.seatbid.length > 0 && response.seatbid[0].bid) {
response.seatbid.forEach(function (emxBid) {
emxBid = emxBid.bid[0];
emxBidResponses.push({
requestId: emxBid.id,
cpm: emxBid.price,
width: emxBid.w,
height: emxBid.h,
creativeId: emxBid.crid || emxBid.id,
dealId: emxBid.dealid || null,
currency: 'USD',
netRevenue: true,
mediaType: BANNER,
ad: decodeURIComponent(emxBid.adm),
ttl: emxBid.ttl
});
});
}
return emxBidResponses;
},
getUserSyncs: function (syncOptions) {
const syncs = [];
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: '//biddr.brealtime.com/check.html'
});
}
if (syncOptions.pixelEnabled) {
syncs.push({
type: 'image',
url: '//edba.brealtime.com/'
});
}
return syncs;
}
};
registerBidder(spec);
Loading

0 comments on commit 059a38b

Please sign in to comment.