Skip to content

Rename idWardRtdProvider to anonymisedRtdProvider #10176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 26, 2024
Merged
Next Next commit
rename idWardRtdProvider to anonymisedRtdProvider
  • Loading branch information
Pavlo committed Jul 3, 2023
commit d83aa63a549b30c1484b50e59683f9b58fc69ede
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
ortb2: {
user: {
data: [
// ID Ward segment taxonomy inserted here
// Anonymised segment taxonomy inserted here
]
},
},
realTimeData: {
dataProviders: [
{
name: "idWard",
name: "anonymised",
params: {
cohortStorageKey: "cohort_ids",

Expand Down
24 changes: 12 additions & 12 deletions modules/idWardRtdProvider.js → modules/anonymisedRtdProvider.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* This module adds the ID Ward RTD provider to the real time data module
* This module adds the Anonymised RTD provider to the real time data module
* The {@link module:modules/realTimeData} module is required
* The module will poulate real-time data from ID Ward
* @module modules/idWardRtdProvider
* The module will poulate real-time data from Anonymised
* @module modules/anonymisedRtdProvider
* @requires module:modules/realTimeData
*/
import {getStorageManager} from '../src/storageManager.js';
Expand All @@ -11,7 +11,7 @@ import {isPlainObject, mergeDeep, logMessage, logError} from '../src/utils.js';
import {MODULE_TYPE_RTD} from '../src/activities/modules.js';

const MODULE_NAME = 'realTimeData';
const SUBMODULE_NAME = 'idWard';
const SUBMODULE_NAME = 'anonymised';

export const storage = getStorageManager({moduleType: MODULE_TYPE_RTD, moduleName: SUBMODULE_NAME});
/**
Expand All @@ -21,8 +21,8 @@ export const storage = getStorageManager({moduleType: MODULE_TYPE_RTD, moduleNam
*/
function addRealTimeData(ortb2, rtd) {
if (isPlainObject(rtd.ortb2)) {
logMessage('idWardRtdProvider: merging original: ', ortb2);
logMessage('idWardRtdProvider: merging in: ', rtd.ortb2);
logMessage('anonymisedRtdProvider: merging original: ', ortb2);
logMessage('anonymisedRtdProvider: merging in: ', rtd.ortb2);
mergeDeep(ortb2, rtd.ortb2);
}
}
Expand All @@ -35,13 +35,13 @@ function tryParse(data) {
try {
return JSON.parse(data);
} catch (err) {
logError(`idWardRtdProvider: failed to parse json:`, data);
logError(`anonymisedRtdProvider: failed to parse json:`, data);
return null;
}
}

/**
* Real-time data retrieval from ID Ward
* Real-time data retrieval from Anonymised
* @param {Object} reqBidsConfigObj
* @param {function} onDone
* @param {Object} rtdConfig
Expand All @@ -59,14 +59,14 @@ export function getRealTimeData(reqBidsConfigObj, onDone, rtdConfig, userConsent

if (segments) {
const udSegment = {
name: 'id-ward.com',
name: 'anonymised.io',
ext: {
segtax: rtdConfig.params.segtax
},
segment: segments.map(x => ({id: x}))
}

logMessage('idWardRtdProvider: user.data.segment: ', udSegment);
logMessage('anonymisedRtdProvider: user.data.segment: ', udSegment);
const data = {
rtd: {
ortb2: {
Expand Down Expand Up @@ -95,10 +95,10 @@ function init(provider, userConsent) {
}

/** @type {RtdSubmodule} */
export const idWardRtdSubmodule = {
export const anonymisedRtdSubmodule = {
name: SUBMODULE_NAME,
getBidRequestData: getRealTimeData,
init: init
};

submodule(MODULE_NAME, idWardRtdSubmodule);
submodule(MODULE_NAME, anonymisedRtdSubmodule);
43 changes: 43 additions & 0 deletions modules/anonymisedRtdProvider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
### Overview

Anonymised is a data anonymization technology for privacy-preserving advertising. Publishers and advertisers are able to target and retarget custom audience segments covering 100% of consented audiences.
Anonymised’s Real-time Data Provider automatically obtains segment IDs from the Anonymised on-domain script (via localStorage) and passes them to the bid-stream.

### Integration

- Build the anonymisedRtd module into the Prebid.js package with:

```bash
gulp build --modules=anonymisedRtdProvider,...
```

- Use `setConfig` to instruct Prebid.js to initilaize the anonymisedRtdProvider module, as specified below.

### Configuration

```javascript
pbjs.setConfig({
realTimeData: {
dataProviders: [
{
name: "anonymised",
waitForIt: true,
params: {
cohortStorageKey: "cohort_ids"
}
}
]
}
});
```

Please note that anonymisedRtdProvider should be integrated into the publisher website along with the [Anonymised Marketing Tag](https://support.anonymised.io/integrate/marketing-tag).
Please reach out to Anonymised [representative](mailto:[email protected]) if you have any questions or need further help to integrate Prebid, anonymisedRtdProvider, and Anonymised Marketing Tag

### Testing
To view an example of available segments returned by Anonymised:
```bash
gulp serve --modules=rtdModule,anonymisedRtdProvider,pubmaticBidAdapter
```
and then point your browser at:
"http://localhost:9999/integrationExamples/gpt/anonymised_segments_example.html"
44 changes: 0 additions & 44 deletions modules/idWardRtdProvider.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {config} from 'src/config.js';
import {getRealTimeData, idWardRtdSubmodule, storage} from 'modules/idWardRtdProvider.js';
import {getRealTimeData, anonymisedRtdSubmodule, storage} from 'modules/anonymisedRtdProvider.js';

describe('idWardRtdProvider', function() {
describe('anonymisedRtdProvider', function() {
let getDataFromLocalStorageStub;

const testReqBidsConfigObj = {
Expand All @@ -15,7 +15,7 @@ describe('idWardRtdProvider', function() {
const onDone = function() { return true };

const cmoduleConfig = {
'name': 'idWard',
'name': 'anonymised',
'params': {
'cohortStorageKey': 'cohort_ids'
}
Expand All @@ -30,9 +30,9 @@ describe('idWardRtdProvider', function() {
getDataFromLocalStorageStub.restore();
});

describe('idWardRtdSubmodule', function() {
describe('anonymisedRtdSubmodule', function() {
it('successfully instantiates', function () {
expect(idWardRtdSubmodule.init()).to.equal(true);
expect(anonymisedRtdSubmodule.init()).to.equal(true);
});
});

Expand All @@ -52,7 +52,7 @@ describe('idWardRtdProvider', function() {
};

const rtdUserObj1 = {
name: 'id-ward.com',
name: 'anonymised.io',
ext: {
segtax: 503
},
Expand Down