这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
realTimeData: {
dataProviders: [
{
name: "azerion",
name: "azerionedge",
waitForIt: true,
params: { bidders: ["appnexus"] },
},
Expand Down Expand Up @@ -77,7 +77,7 @@
</head>

<body>
<h2>Azerion RTD</h2>
<h2>Azerion Edge RTD</h2>

<div id="test-div">
<script>
Expand Down
2 changes: 1 addition & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"airgridRtdProvider",
"akamaiDapRtdProvider",
"arcspanRtdProvider",
"azerionRtdProvider",
"azerionedgeRtdProvider",
"blueconicRtdProvider",
"brandmetricsRtdProvider",
"browsiRtdProvider",
Expand Down
44 changes: 29 additions & 15 deletions modules/azerionRtdProvider.js → modules/azerionedgeRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This module adds the Azerion provider to the real time data module of prebid.
*
* The {@link module:modules/realTimeData} module is required
* @module modules/azerionRtdProvider
* @module modules/azerionedgeRtdProvider
* @requires module:modules/realTimeData
*/
import { submodule } from '../src/hook.js';
Expand All @@ -12,15 +12,16 @@ import { loadExternalScript } from '../src/adloader.js';
import { MODULE_TYPE_RTD } from '../src/activities/modules.js';

/**
* @typedef {import('../modules/rtdModule/index.js').RtdSubmodule} RtdSubmodule
* @typedef {import('./rtdModule/index.js').RtdSubmodule} RtdSubmodule
*/

const REAL_TIME_MODULE = 'realTimeData';
const SUBREAL_TIME_MODULE = 'azerion';
const SUBREAL_TIME_MODULE = 'azerionedge';
export const STORAGE_KEY = 'ht-pa-v1-a';

export const storage = getStorageManager({
moduleType: MODULE_TYPE_RTD, moduleName: SUBREAL_TIME_MODULE
moduleType: MODULE_TYPE_RTD,
moduleName: SUBREAL_TIME_MODULE,
});

/**
Expand Down Expand Up @@ -61,7 +62,7 @@ export function attachScript(config) {
export function getAudiences() {
try {
const data = storage.getDataFromLocalStorage(STORAGE_KEY);
return JSON.parse(data).map(({id}) => id);
return JSON.parse(data).map(({ id }) => id);
} catch (_) {
return [];
}
Expand All @@ -79,13 +80,21 @@ export function getAudiences() {
export function setAudiencesToBidders(reqBidsConfigObj, config, audiences) {
const defaultBidders = ['improvedigital'];
const bidders = config.params?.bidders || defaultBidders;
bidders.forEach((bidderCode) => mergeDeep(reqBidsConfigObj.ortb2Fragments.bidder, {[bidderCode]: {
user: {
data: [
{ name: 'azerion', ext: { segtax: 4 }, segment: audiences.map(id => ({id})) }
]
}
}}));
bidders.forEach((bidderCode) =>
mergeDeep(reqBidsConfigObj.ortb2Fragments.bidder, {
[bidderCode]: {
user: {
data: [
{
name: 'azerionedge',
ext: { segtax: 4 },
segment: audiences.map((id) => ({ id })),
},
],
},
},
})
);
}

/**
Expand All @@ -111,7 +120,12 @@ function init(config, userConsent) {
*
* @return {void}
*/
export function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
export function getBidRequestData(
reqBidsConfigObj,
callback,
config,
userConsent
) {
const audiences = getAudiences();
if (audiences.length > 0) {
setAudiencesToBidders(reqBidsConfigObj, config, audiences);
Expand All @@ -120,10 +134,10 @@ export function getBidRequestData(reqBidsConfigObj, callback, config, userConsen
}

/** @type {RtdSubmodule} */
export const azerionSubmodule = {
export const azerionedgeSubmodule = {
name: SUBREAL_TIME_MODULE,
init: init,
getBidRequestData: getBidRequestData,
};

submodule(REAL_TIME_MODULE, azerionSubmodule);
submodule(REAL_TIME_MODULE, azerionedgeSubmodule);
32 changes: 15 additions & 17 deletions modules/azerionRtdProvider.md → modules/azerionedgeRtdProvider.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
---
layout: page_v2
title: azerion RTD Provider
display_name: Azerion RTD Provider
title: azerion edge RTD Provider
display_name: Azerion Edge RTD Provider
description: Client-side contextual cookieless audiences.
page_type: module
module_type: rtd
module_code: azerionRtdProvider
module_code: azerionedgeRtdProvider
enable_download: true
vendor_specific: true
sidebarType: 1
---

# Azerion RTD Provider
# Azerion Edge RTD Provider

Client-side contextual cookieless audiences.

Azerion RTD module helps publishers to capture users' interest
Azerion Edge RTD module helps publishers to capture users' interest
audiences on their site, and attach these into the bid request.

Maintainer: [azerion.com](https://www.azerion.com/)

{:.no_toc}

- TOC
{:toc}

## Integration

Compile the Azerion RTD module (`azerionRtdProvider`) into your Prebid build,
Compile the Azerion Edge RTD module (`azerionedgeRtdProvider`) into your Prebid build,
along with the parent RTD Module (`rtdModule`):

```bash
gulp build --modules=rtdModule,azerionRtdProvider,appnexusBidAdapter,improvedigitalBidAdapter
gulp build --modules=rtdModule,azerionedgeRtdProvider,improvedigitalBidAdapter
```

Set configuration via `pbjs.setConfig`.
Expand All @@ -41,7 +43,7 @@ pbjs.setConfig(
auctionDelay: 1000,
dataProviders: [
{
name: 'azerion',
name: 'azerionedge',
waitForIt: true,
params: {
key: '',
Expand All @@ -60,7 +62,7 @@ pbjs.setConfig(
{: .table .table-bordered .table-striped }
| Name | Type | Description | Notes |
| :--- | :------- | :------------------ | :--------------- |
| name | `String` | RTD sub module name | Always "azerion" |
| name | `String` | RTD sub module name | Always "azerionedge" |
| waitForIt | `Boolean` | Required to ensure that the auction is delayed for the module to respond. | Optional. Defaults to false but recommended to true. |
| params.key | `String` | Publisher partner specific key | Optional |
| params.bidders | `Array` | Bidders with which to share segment information | Optional. Defaults to "improvedigital". |
Expand All @@ -86,7 +88,7 @@ as exception, as shown below:
purpose: 'storage',
enforcePurpose: true,
enforceVendor: true,
vendorExceptions: ["azerion"]
vendorExceptions: ["azerionedge"]
},
...
]
Expand All @@ -97,18 +99,14 @@ as exception, as shown below:
To view an example:

```bash
gulp serve-fast --modules=rtdModule,azerionRtdProvider,improvedigitalBidAdapter
gulp serve-fast --modules=rtdModule,azerionedgeRtdProvider,improvedigitalBidAdapter
```

Access [http://localhost:9999/integrationExamples/gpt/azerionRtdProvider_example.html](http://localhost:9999/integrationExamples/gpt/azerionRtdProvider_example.html)
Access [http://localhost:9999/integrationExamples/gpt/azerionedgeRtdProvider_example.html](http://localhost:9999/integrationExamples/gpt/azerionedgeRtdProvider_example.html)
in your browser.

Run the unit tests:

```bash
npm test -- --file "test/spec/modules/azerionRtdProvider_spec.js"
npm test -- --file "test/spec/modules/azerionedgeRtdProvider_spec.js"
```

## Support

If you require further assistance please contact [support@azerion.com](mailto:support@azerion.com).
4 changes: 2 additions & 2 deletions src/adloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const _approvedLoadExternalJSList = [
'hadron',
'medianet',
'improvedigital',
'azerion',
'azerionedge',
'aaxBlockmeter',
'confiant',
'arcspan',
Expand All @@ -34,7 +34,7 @@ const _approvedLoadExternalJSList = [
'contxtful',
'id5',
'lucead',
]
];

/**
* Loads external javascript. Can only be used if external JS is approved by Prebid. See https://github.com/prebid/prebid-js-external-js-template#policy
Expand Down
152 changes: 0 additions & 152 deletions test/spec/modules/azerionRtdProvider_spec.js

This file was deleted.

Loading