Skip to content

Commit

Permalink
Merge branch 'master' into Widespace_adapter
Browse files Browse the repository at this point in the history
* master:
  Audience Network: Add 'pbv' and 'cb' query params (prebid#2252)
  Add e-planning analytics adapter (prebid#2211)
  Add vastUrl for Gamma Adapter Video (prebid#2261)
  update params for test bid (prebid#2267)
  Updated adUnitCode (prebid#2262)
  vastUrl is set based on nurl for video. (prebid#2249)
  Added ad id to a4g bid (prebid#2250)
  Add billing url (burl) support (prebid#2246)
  Fix: add mediatype in bid response (prebid#2260)
  use b64EncodeUnicode to encode strings with unicode chars in them (prebid#2245)
  create RELEASE_SCHEDULE.md (prebid#2255)
  Update Platform.io Adapter (prebid#2230)
  Update Lifestreet adapter to 1.0 (prebid#2197)
  PBS adapter not sending app or device (prebid#2206)
  Fix prebid#2229 - Edge cookie string form (prebid#2236)
  Add Invibes Adapter (prebid#2202)
  • Loading branch information
mizmaar3 committed Mar 19, 2018
2 parents c85eaf3 + 7d10bc7 commit 54e5d4c
Show file tree
Hide file tree
Showing 30 changed files with 2,071 additions and 465 deletions.
22 changes: 22 additions & 0 deletions RELEASE_SCHEDULE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Release Schedule

We push a new release of Prebid.js every other week on Tuesday. During the adoption phase for 1.x, we are releasing updates for 1.x and 0.x at the same time.

While the releases will be available immediately for those using direct Git access,
it will be about a week before the Prebid Org [Download Page](http://prebid.org/download.html) will be updated.

You can determine what is in a given build using the [releases page](https://github.com/prebid/Prebid.js/releases)

Announcements regarding releases will be made to the #headerbidding-dev channel in subredditadops.slack.com.

# FAQs

**1. Is there flexibility in the 2-week schedule?**

If a major bug is found in the current release, a maintenance patch will be done as soon as possible.

It is unlikely that we will put out a maintenance patch at the request of a given bid adapter or module owner.

**2. What Pull Requests make it into a release?**

Every PR that's merged into master will be part of a release. Here are the [PR review guidelines](https://github.com/prebid/Prebid.js/blob/master/PR_REVIEW.md).
5 changes: 3 additions & 2 deletions modules/a4gBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const spec = {
if (!bidId) {
bidId = bid.bidId;
}
idParams.push(bid.placementCode);
idParams.push(bid.adUnitCode);
sizeParams.push(bid.sizes.map(size => size.join(SIZE_SEPARATOR)).join(ARRAY_SIZE_SEPARATOR));
zoneIds.push(bid.params.zoneId);
});
Expand Down Expand Up @@ -71,7 +71,8 @@ export const spec = {
currency: A4G_CURRENCY,
netRevenue: true,
ttl: A4G_TTL,
ad: response.ad
ad: response.ad,
adId: response.id
};
bidResponses.push(bidResponse);
});
Expand Down
9 changes: 7 additions & 2 deletions modules/audienceNetworkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { registerBidder } from 'src/adapters/bidderFactory';
import { config } from 'src/config';
import { formatQS } from 'src/url';
import { getTopWindowUrl } from 'src/utils';
import { generateUUID, getTopWindowUrl, isSafariBrowser } from 'src/utils';
import findIndex from 'core-js/library/fn/array/find-index';
import includes from 'core-js/library/fn/array/includes';

Expand All @@ -15,6 +15,7 @@ const url = 'https://an.facebook.com/v2/placementbid.json';
const supportedMediaTypes = ['banner', 'video'];
const netRevenue = true;
const hb_bidder = 'fan';
const pbv = '$prebid.version$';

/**
* Does this bid request contain valid parameters?
Expand Down Expand Up @@ -164,12 +165,16 @@ const buildRequests = bids => {
adformats,
testmode,
pageurl,
sdk
sdk,
pbv
};
const video = findIndex(adformats, isVideo);
if (video !== -1) {
[search.playerwidth, search.playerheight] = expandSize(sizes[video]);
}
if (isSafariBrowser()) {
search.cb = generateUUID();
}
const data = formatQS(search);

return [{ adformats, data, method, requestIds, sizes, url }];
Expand Down
131 changes: 131 additions & 0 deletions modules/eplanningAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import {ajax} from 'src/ajax';
import adapter from 'src/AnalyticsAdapter';
import adaptermanager from 'src/adaptermanager';
import * as utils from 'src/utils';

const CONSTANTS = require('src/constants.json');

const analyticsType = 'endpoint';
const EPL_HOST = 'https://ads.us.e-planning.net/hba/1/';

function auctionEndHandler(args) {
return {auctionId: args.auctionId};
}

function auctionInitHandler(args) {
return {
auctionId: args.auctionId,
time: args.timestamp
};
}

function bidRequestedHandler(args) {
return {
auctionId: args.auctionId,
time: args.start,
bidder: args.bidderCode,
bids: args.bids.map(function(bid) {
return {
time: bid.startTime,
bidder: bid.bidder,
placementCode: bid.placementCode,
auctionId: bid.auctionId,
sizes: bid.sizes
};
}),
};
}

function bidResponseHandler(args) {
return {
bidder: args.bidder,
size: args.size,
auctionId: args.auctionId,
cpm: args.cpm,
time: args.responseTimestamp,
};
}

function bidWonHandler(args) {
return {
auctionId: args.auctionId,
size: args.width + 'x' + args.height,
};
}

function bidTimeoutHandler(args) {
return args.map(function(bid) {
return {
bidder: bid.bidder,
auctionId: bid.auctionId
};
})
}

function callHandler(evtype, args) {
let handler = null;

if (evtype === CONSTANTS.EVENTS.AUCTION_INIT) {
handler = auctionInitHandler;
eplAnalyticsAdapter.context.events = [];
} else if (evtype === CONSTANTS.EVENTS.AUCTION_END) {
handler = auctionEndHandler;
} else if (evtype === CONSTANTS.EVENTS.BID_REQUESTED) {
handler = bidRequestedHandler;
} else if (evtype === CONSTANTS.EVENTS.BID_RESPONSE) {
handler = bidResponseHandler
} else if (evtype === CONSTANTS.EVENTS.BID_TIMEOUT) {
handler = bidTimeoutHandler;
} else if (evtype === CONSTANTS.EVENTS.BID_WON) {
handler = bidWonHandler;
}

if (handler) {
eplAnalyticsAdapter.context.events.push({ec: evtype, p: handler(args)});
}
}

var eplAnalyticsAdapter = Object.assign(adapter(
{
EPL_HOST,
analyticsType
}),
{
track({eventType, args}) {
if (typeof args !== 'undefined') {
callHandler(eventType, args);
}

if (eventType === CONSTANTS.EVENTS.AUCTION_END) {
try {
let strjson = JSON.stringify(eplAnalyticsAdapter.context.events);
ajax(eplAnalyticsAdapter.context.host + eplAnalyticsAdapter.context.ci + '?d=' + encodeURIComponent(strjson));
} catch (err) {}
}
}
}
);

eplAnalyticsAdapter.originEnableAnalytics = eplAnalyticsAdapter.enableAnalytics;

eplAnalyticsAdapter.enableAnalytics = function (config) {
if (!config.options.ci) {
utils.logError('Client ID (ci) option is not defined. Analytics won\'t work');
return;
}

eplAnalyticsAdapter.context = {
events: [],
host: config.options.host || EPL_HOST,
ci: config.options.ci
};

eplAnalyticsAdapter.originEnableAnalytics(config);
};

adaptermanager.registerAnalyticsAdapter({
adapter: eplAnalyticsAdapter,
code: 'eplanning'
});

export default eplAnalyticsAdapter;
23 changes: 23 additions & 0 deletions modules/eplanningAnalyticsAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Overview

```
Module Name: E-Planning Analytics Adapter
Module Type: Analytics Adapter
Maintainer: mmartinho@e-planning.net
```

# Description

Analytics adapter for E-Planning.

# Test Parameters

```
{
provider: 'eplanning',
options : {
host: 'https://ads.us.e-planning.net/hba/1/', // Host (optional)
ci: "123456" // Client ID (required)
}
}
```
2 changes: 2 additions & 0 deletions modules/gammaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const BIDDER_CODE = 'gamma';
export const spec = {
code: BIDDER_CODE,
aliases: ['gamma'],
supportedMediaTypes: ['banner', 'video'],

/**
* Determines whether or not the given bid request is valid.
Expand Down Expand Up @@ -85,6 +86,7 @@ function newBid(serverBid) {
if (serverBid.type == 'video') {
Object.assign(bid, {
vastXml: serverBid.seatbid[0].bid[0].vastXml,
vastUrl: serverBid.seatbid[0].bid[0].vastUrl,
ttl: 3600
});
}
Expand Down
19 changes: 18 additions & 1 deletion modules/gammaBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Connects to Gamma exchange for bids.

Gamma bid adapter supports Banner, Video.

# Test Parameters
# Test Parameters: For Banner
```
var adUnits = [{
code: 'gamma-hb-ad-123456-0',
Expand All @@ -29,6 +29,23 @@ var adUnits = [{
}];
```
# Test Parameters: For Video
```
var adUnits = [{
code: 'gamma-hb-ad-78910-0',
sizes: [[640, 480]],
// Replace this object to test a new Adapter!
bids: [{
bidder: 'gamma',
params: {
siteId: '1465446377',
zoneId: '1493280341'
}
}]
}];
```
# Ad Unit and Setup: For Testing
In order to receive bids please map localhost to (any) test domain.

Expand Down
Loading

0 comments on commit 54e5d4c

Please sign in to comment.