-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimon Analytics Adapter: add new analytics adapter (#6333)
* Publish the Optimon platform's analytics adapter for prebid Added js and md files for the analytics adapter. * Fix wrong content in MD file * Fix wrong content in MD file * Created unit testing to Optimon Analytics Adapter * Created unit testing to Optimon Analytics Adapter * Created unit testing to Optimon Analytics Adapter * Created unit testing to Optimon Analytics Adapter * Fixes ESlint styling * Removing DEF const * Created unit testing to Optimon Analytics Adapter * Created unit testing to Optimon Analytics Adapter
- Loading branch information
1 parent
1dc7c05
commit f03e95a
Showing
3 changed files
with
78 additions
and
0 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,25 @@ | ||
/** | ||
* | ||
********************************************************* | ||
* | ||
* Optimon.io Prebid Analytics Adapter | ||
* | ||
********************************************************* | ||
* | ||
*/ | ||
|
||
import adapter from '../src/AnalyticsAdapter.js'; | ||
import adapterManager from '../src/adapterManager.js'; | ||
|
||
const optimonAnalyticsAdapter = adapter({ | ||
global: 'OptimonAnalyticsAdapter', | ||
handler: 'on', | ||
analyticsType: 'bundle' | ||
}); | ||
|
||
adapterManager.registerAnalyticsAdapter({ | ||
adapter: optimonAnalyticsAdapter, | ||
code: 'optimon', | ||
}); | ||
|
||
export default optimonAnalyticsAdapter; |
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,13 @@ | ||
# Overview | ||
|
||
Module Name: Optimon.io Prebid Analytics Adapter | ||
Module Type: Analytics Adapter | ||
Maintainer: [email protected] | ||
|
||
# Description | ||
|
||
Start analyzing your Prebid performance by visiting our website [Optimon.io](https://optimon.io/?utm_source=prebid-org&utm_medium=analytics-adapter) or contact us directly by email: [[email protected]](mailto:[email protected]) to get started. | ||
|
||
# Platform Details | ||
|
||
[Optimon.io](https://optimon.io/?utm_source=prebid-org&utm_medium=analytics-adapter) is a Robust Alerting & Reporting Platform for Prebid and GAM that helps publishers make the right decisions by collecting data from your Google Ad Manager, Prebid, and other SSPs and providing smart insights and suggestions to optimize and maximize their overall yield and save manual work. |
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,40 @@ | ||
import * as utils from 'src/utils.js'; | ||
import { expect } from 'chai'; | ||
import optimonAnalyticsAdapter from '../../../modules/optimonAnalyticsAdapter.js'; | ||
import adapterManager from 'src/adapterManager'; | ||
import events from 'src/events'; | ||
import constants from 'src/constants.json' | ||
|
||
const AD_UNIT_CODE = 'demo-adunit-1'; | ||
const PUBLISHER_CONFIG = { | ||
pubId: 'optimon_test', | ||
pubAdxAccount: 123456789, | ||
pubTimezone: 'Asia/Jerusalem' | ||
}; | ||
|
||
describe('Optimon Analytics Adapter', () => { | ||
const optmn_currentWindow = utils.getWindowSelf(); | ||
let optmn_queue = []; | ||
|
||
beforeEach(() => { | ||
optmn_currentWindow.OptimonAnalyticsAdapter = (...optmn_args) => optmn_queue.push(optmn_args); | ||
adapterManager.enableAnalytics({ | ||
provider: 'optimon' | ||
}); | ||
optmn_queue = [] | ||
}); | ||
|
||
afterEach(() => { | ||
optimonAnalyticsAdapter.disableAnalytics(); | ||
}); | ||
|
||
it('should forward all events to the queue', () => { | ||
const optmn_arguments = [AD_UNIT_CODE, PUBLISHER_CONFIG]; | ||
|
||
events.emit(constants.EVENTS.AUCTION_END, optmn_arguments) | ||
events.emit(constants.EVENTS.BID_TIMEOUT, optmn_arguments) | ||
events.emit(constants.EVENTS.BID_WON, optmn_arguments) | ||
|
||
expect(optmn_queue.length).to.eql(3); | ||
}); | ||
}); |