Skip to content
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

Utiq user sub-module: Remove unused domain assingment #9995

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
562c790
feature: Add trustpid user id module
Dec 22, 2021
2885867
Merge branch 'master' of github.com:prebid/Prebid.js
Dec 22, 2021
2f126b7
refactor: Update trustpidSystem module, comments and md file
Jan 11, 2022
8f63746
refactor: Update trustpidSystem file to handle domain setting regardl…
Jan 11, 2022
6f71cb0
Merge branch 'master' of github.com:prebid/Prebid.js
Jan 12, 2022
1c170f1
refactor: Update trustpidSystem module and dependent tests and docs
Jan 17, 2022
894b1b8
Merge branch 'master' of github.com:prebid/Prebid.js
Jan 17, 2022
383e5c3
refactor: Update trustpid undefined checks and returns
Jan 17, 2022
9c312b3
tests: Update trustpid tests
Jan 17, 2022
adf5526
docs: Update trustpid docs typo
Jan 17, 2022
35f97ca
Merge branch 'master' of github.com:prebid/Prebid.js
Feb 28, 2022
1e10661
refactor: Update trustpid acronyms logic
Mar 1, 2022
a3ea3bb
Merge branch 'master' of github.com:prebid/Prebid.js
Mar 28, 2022
565c5d0
Merge pull request #8 from Teavaro/refactor-update-trustpid-acronyms
jkthomas Mar 28, 2022
2b6648a
Merge branch 'master' of github.com:prebid/Prebid.js
Jul 15, 2022
eaa4f22
Merge branch 'master' of github.com:Teavaro/Prebid.js-private
Jul 15, 2022
e21bda9
TrustPid: Remove deprecated acronyms logic
Jul 18, 2022
d3fdf94
Merge branch 'master' of github.com:prebid/Prebid.js
Aug 22, 2022
f4ab4ba
Merge branch 'master' of github.com:prebid/Prebid.js
Apr 27, 2023
3a8d752
Rename TrustPid User ID module to Utiq
Apr 28, 2023
2c3f937
Merge branch 'master' of github.com:prebid/Prebid.js
May 24, 2023
9262410
Utiq sub-module: Remove unused domain assignment
May 24, 2023
7c0d0a1
Utiq sub-module: Update local storage entries naming
May 24, 2023
e58003c
Merge branch 'master' of github.com:prebid/Prebid.js
May 30, 2023
925db42
Utiq sub-module: Update tests
May 30, 2023
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
2 changes: 1 addition & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"tapadIdSystem",
"teadsIdSystem",
"tncIdSystem",
"trustpidSystem",
"utiqSystem",
"uid2IdSystem",
"unifiedIdSystem",
"verizonMediaIdSystem",
Expand Down
2 changes: 1 addition & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SOURCE_RTI_MAPPING = {
'epsilon.com': '', // Publisher Link, publinkId
'audigent.com': '', // Hadron ID from Audigent, hadronId
'pubcid.org': '', // SharedID, pubcid
'trustpid.com': '', // Trustpid
'utiq.com': '', // Utiq
'intimatemerger.com': ''
};
const PROVIDERS = [
Expand Down
143 changes: 0 additions & 143 deletions modules/trustpidSystem.js

This file was deleted.

6 changes: 3 additions & 3 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const USER_IDS_CONFIG = {
}
},

// trustpid
'trustpid': {
source: 'trustpid.com',
// utiq
'utiq': {
source: 'utiq.com',
atype: 1,
getValue: function (data) {
return data;
Expand Down
2 changes: 1 addition & 1 deletion modules/userId/eids.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ userIdAsEids = [
}]
},
{
source: 'trustpid.com',
source: 'utiq.com',
uids: [{
id: 'some-random-id-value',
atype: 1
Expand Down
22 changes: 12 additions & 10 deletions modules/userId/userId.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,22 @@ pbjs.setConfig({
}
});
```

```

Example showing how to configure a `params` object to pass directly to bid adapters

```

pbjs.setConfig({
userSync: {
userIds: [{
name: 'tncId',
params: {
providerId: "c8549079-f149-4529-a34b-3fa91ef257d1"
}
}],
syncDelay: 5000
}
userSync: {
userIds: [{
name: 'tncId',
params: {
providerId: "c8549079-f149-4529-a34b-3fa91ef257d1"
}
}],
syncDelay: 5000
}
});
```
```
129 changes: 129 additions & 0 deletions modules/utiqSystem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/**
* This module adds Utiq provided by Utiq SA/NV to the User ID module
* The {@link module:modules/userId} module is required
* @module modules/utiqSystem
* @requires module:modules/userId
*/
import { logInfo } from '../src/utils.js';
import { submodule } from '../src/hook.js';
import { getStorageManager } from '../src/storageManager.js';
import { MODULE_TYPE_UID } from '../src/activities/modules.js';

const MODULE_NAME = 'utiq';
const LOG_PREFIX = 'Utiq module';

export const storage = getStorageManager({
moduleType: MODULE_TYPE_UID,
moduleName: MODULE_NAME,
});

/**
* Get the "atid" from html5 local storage to make it available to the UserId module.
* @param config
* @returns {{utiq: (*|string)}}
*/
function getUtiqFromStorage() {
let utiqPass;
let utiqPassStorage = JSON.parse(
storage.getDataFromLocalStorage('utiqPass')
);
logInfo(
`${LOG_PREFIX}: Local storage utiqPass: ${JSON.stringify(
utiqPassStorage
)}`
);

if (
utiqPassStorage &&
utiqPassStorage.connectId &&
Array.isArray(utiqPassStorage.connectId.idGraph) &&
utiqPassStorage.connectId.idGraph.length > 0
) {
utiqPass = utiqPassStorage.connectId.idGraph[0];
}
logInfo(
`${LOG_PREFIX}: Graph of utiqPass: ${JSON.stringify(
utiqPass
)}`
);

return {
utiq:
utiqPass && utiqPass.atid
? utiqPass.atid
: null,
};
}

/** @type {Submodule} */
export const utiqSubmodule = {
/**
* Used to link submodule with config
* @type {string}
*/
name: MODULE_NAME,
/**
* Decodes the stored id value for passing to bid requests.
* @function
* @returns {{utiq: string} | null}
*/
decode(bidId) {
logInfo(`${LOG_PREFIX}: Decoded ID value ${JSON.stringify(bidId)}`);
return bidId.utiq ? bidId : null;
},
/**
* Get the id from helper function and initiate a new user sync.
* @param config
* @returns {{callback: result}|{id: {utiq: string}}}
*/
getId: function (config) {
const data = getUtiqFromStorage();
if (data.utiq) {
logInfo(`${LOG_PREFIX}: Local storage ID value ${JSON.stringify(data)}`);
return { id: { utiq: data.utiq } };
} else {
if (!config) {
config = {};
}
if (!config.params) {
config.params = {};
}
if (
typeof config.params.maxDelayTime === 'undefined' ||
config.params.maxDelayTime === null
) {
config.params.maxDelayTime = 1000;
}
// Current delay and delay step in milliseconds
let currentDelay = 0;
const delayStep = 50;
const result = (callback) => {
const data = getUtiqFromStorage();
if (!data.utiq) {
if (currentDelay > config.params.maxDelayTime) {
logInfo(
`${LOG_PREFIX}: No utiq value set after ${config.params.maxDelayTime} max allowed delay time`
);
callback(null);
} else {
currentDelay += delayStep;
setTimeout(() => {
result(callback);
}, delayStep);
}
} else {
const dataToReturn = { utiq: data.utiq };
logInfo(
`${LOG_PREFIX}: Returning ID value data of ${JSON.stringify(
dataToReturn
)}`
);
callback(dataToReturn);
}
};
return { callback: result };
}
},
};

submodule('userId', utiqSubmodule);
14 changes: 7 additions & 7 deletions modules/trustpidSystem.md → modules/utiqSystem.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## trustpid User Id Submodule
## Utiq User ID Submodule

trustpid User Id Module.
Utiq ID Module.

First, make sure to add the trustpid submodule to your Prebid.js package with:
First, make sure to add the utiq submodule to your Prebid.js package with:

```
gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,trustpidSystem
gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,utiqSystem
```

## Parameter Descriptions

| Params under userSync.userIds[] | Type | Description | Example |
| ------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------- |
| name | String | The name of the module | `"trustpid"` |
| params | Object | Object with configuration parameters for trustpid User Id submodule | - |
| name | String | The name of the module | `"utiq"` |
| params | Object | Object with configuration parameters for utiq User Id submodule | - |
| params.maxDelayTime | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 |
| bidders | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | [`"adf"`, `"adformPBS"`, `"ix"`] |
| storage | Object | Local storage configuration object | - |
| storage.type | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` |
| storage.name | String | The name of the key in local storage where the user ID will be stored. | `"trustpid"` |
| storage.name | String | The name of the key in local storage where the user ID will be stored. | `"utiq"` |
| storage.expires | Integer | How long (in days) the user ID information will be stored. For safety reasons, this information is required. | `1` |
Loading