From cef70b41bc65c45d20c8bc1f0645cfa7c28b3fdc Mon Sep 17 00:00:00 2001 From: David Spohr Date: Wed, 18 Jan 2023 15:17:52 +0100 Subject: [PATCH] Renamed cpexId to czechAdId --- modules/.submodules.json | 2 +- modules/cpexIdSystem.md | 27 ------------------- .../{cpexIdSystem.js => czechAdIdSystem.js} | 14 +++++----- modules/czechAdIdSystem.md | 27 +++++++++++++++++++ modules/userId/eids.js | 4 +-- modules/userId/userId.md | 2 +- test/spec/modules/cpexIdSystem_spec.js | 18 ++++++------- test/spec/modules/eids_spec.js | 4 +-- 8 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 modules/cpexIdSystem.md rename modules/{cpexIdSystem.js => czechAdIdSystem.js} (82%) create mode 100644 modules/czechAdIdSystem.md diff --git a/modules/.submodules.json b/modules/.submodules.json index deeee91e247..8afcd877606 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -7,7 +7,7 @@ "amxIdSystem", "britepoolIdSystem", "connectIdSystem", - "cpexIdSystem", + "czechAdIdSystem", "criteoIdSystem", "dacIdSystem", "deepintentDpesIdSystem", diff --git a/modules/cpexIdSystem.md b/modules/cpexIdSystem.md deleted file mode 100644 index 8aceb7fe4ec..00000000000 --- a/modules/cpexIdSystem.md +++ /dev/null @@ -1,27 +0,0 @@ -## CPEx User ID Submodule - -CPExID is provided by [Czech Publisher Exchange](https://www.cpex.cz/), or CPEx. It is a user ID for ad targeting by using first party cookie, or localStorage mechanism. Please contact CPEx before using this ID. - -## Building Prebid with CPExID Support - -First, make sure to add the cpexId to your Prebid.js package with: - -``` -gulp build --modules=cpexIdSystem -``` - -The following configuration parameters are available: - -```javascript -pbjs.setConfig({ - userSync: { - userIds: [{ - name: 'cpexId' - }] - } -}); -``` - -| Param under userSync.userIds[] | Scope | Type | Description | Example | -| --- | --- | --- | --- | --- | -| name | Required | String | The name of this module. | `"cpexId"` | diff --git a/modules/cpexIdSystem.js b/modules/czechAdIdSystem.js similarity index 82% rename from modules/cpexIdSystem.js rename to modules/czechAdIdSystem.js index 5c2e6bc212d..7354ed2e483 100644 --- a/modules/cpexIdSystem.js +++ b/modules/czechAdIdSystem.js @@ -1,7 +1,7 @@ /** * This module adds 'caid' to the User ID module * The {@link module:modules/userId} module is required - * @module modules/cpexIdSystem + * @module modules/czechAdIdSystem * @requires module:modules/userId */ @@ -9,19 +9,19 @@ import { submodule } from '../src/hook.js' import { getStorageManager } from '../src/storageManager.js' // Returns StorageManager -export const storage = getStorageManager({ gvlid: 570, moduleName: 'cpexId' }) +export const storage = getStorageManager({ gvlid: 570, moduleName: 'czechAdId' }) // Returns the id string from either cookie or localstorage const readId = () => { return storage.getCookie('czaid') || storage.getDataFromLocalStorage('czaid') } /** @type {Submodule} */ -export const cpexIdSubmodule = { - version: '0.0.5', +export const czechAdIdSubmodule = { + version: '0.1.0', /** * used to link submodule with config * @type {string} */ - name: 'cpexId', + name: 'czechAdId', /** * Vendor ID of Czech Publisher Exchange * @type {Number} @@ -32,7 +32,7 @@ export const cpexIdSubmodule = { * @function decode * @returns {(Object|undefined)} */ - decode () { return { cpexId: readId() } }, + decode () { return { czechAdId: readId() } }, /** * performs action to obtain id and return a value in the callback's response argument * @function @@ -44,4 +44,4 @@ export const cpexIdSubmodule = { } } -submodule('userId', cpexIdSubmodule) +submodule('userId', czechAdIdSubmodule) diff --git a/modules/czechAdIdSystem.md b/modules/czechAdIdSystem.md new file mode 100644 index 00000000000..5614016f524 --- /dev/null +++ b/modules/czechAdIdSystem.md @@ -0,0 +1,27 @@ +## CzechAdId User ID Submodule + +Czech Ad ID is a joint project of publishers of the [CPEx alliance](https://www.cpex.cz/) and [Seznam.cz](https://www.seznam.cz). It is a deterministic user ID that offers cross-domain and cross-device identification. For more information see [czechadid.cz](https://www.czechadid.cz)). + +## Building Prebid with CzechAdId Support + +First, make sure to add the czechAdId to your Prebid.js package with: + +``` +gulp build --modules=czechAdIdSystem +``` + +The following configuration parameters are available: + +```javascript +pbjs.setConfig({ + userSync: { + userIds: [{ + name: 'czechAdId' + }] + } +}); +``` + +| Param under userSync.userIds[] | Scope | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Required | String | The name of this module. | `"czechAdId"` | diff --git a/modules/userId/eids.js b/modules/userId/eids.js index bae5071e4b2..c41b6f83d6d 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -345,8 +345,8 @@ export const USER_IDS_CONFIG = { atype: 1 }, - // cpexId - 'cpexId': { + // czechAdId + 'czechAdId': { source: 'czechadid.cz', atype: 1 }, diff --git a/modules/userId/userId.md b/modules/userId/userId.md index f25383af975..5b0145f8a11 100644 --- a/modules/userId/userId.md +++ b/modules/userId/userId.md @@ -102,7 +102,7 @@ pbjs.setConfig({ expires: 1 } }, { - name: "cpexId" + name: "czechAdId" }, { name: 'mwOpenLinkId', params: { diff --git a/test/spec/modules/cpexIdSystem_spec.js b/test/spec/modules/cpexIdSystem_spec.js index e1320d82a6a..6e004c9f8ca 100644 --- a/test/spec/modules/cpexIdSystem_spec.js +++ b/test/spec/modules/cpexIdSystem_spec.js @@ -1,6 +1,6 @@ -import { cpexIdSubmodule, storage } from 'modules/cpexIdSystem.js'; +import { czechAdIdSubmodule, storage } from 'modules/czechAdIdSystem.js'; -describe('cpexId module', function () { +describe('czechAdId module', function () { let getCookieStub; beforeEach(function (done) { @@ -16,23 +16,23 @@ describe('cpexId module', function () { describe('getId()', function () { it('should return the uid when it exists in cookie', function () { - getCookieStub.withArgs('czaid').returns('cpexIdTest'); - const id = cpexIdSubmodule.getId(); - expect(id).to.be.deep.equal({ id: 'cpexIdTest' }); + getCookieStub.withArgs('czaid').returns('czechAdIdTest'); + const id = czechAdIdSubmodule.getId(); + expect(id).to.be.deep.equal({ id: 'czechAdIdTest' }); }); cookieTestCasesForEmpty.forEach(testCase => it('should not return the uid when it doesnt exist in cookie', function () { getCookieStub.withArgs('czaid').returns(testCase); - const id = cpexIdSubmodule.getId(); + const id = czechAdIdSubmodule.getId(); expect(id).to.be.undefined; })); }); describe('decode()', function () { it('should return the uid when it exists in cookie', function () { - getCookieStub.withArgs('czaid').returns('cpexIdTest'); - const decoded = cpexIdSubmodule.decode(); - expect(decoded).to.be.deep.equal({ cpexId: 'cpexIdTest' }); + getCookieStub.withArgs('czaid').returns('czechAdIdTest'); + const decoded = czechAdIdSubmodule.decode(); + expect(decoded).to.be.deep.equal({ czechAdId: 'czechAdIdTest' }); }); }); }); diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index 78c8f2b3148..ba3be282ae6 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -432,9 +432,9 @@ describe('eids array generation for known sub-modules', function() { }); }); - it('cpexId', () => { + it('czechAdId', () => { const id = 'some-random-id-value' - const userId = { cpexId: id }; + const userId = { czechAdId: id }; const [eid] = createEidsArray(userId); expect(eid).to.deep.equal({ source: 'czechadid.cz',