forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Widespace_adapter
* 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
Showing
30 changed files
with
2,071 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [email protected] | ||
``` | ||
|
||
# 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) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.