Skip to content

Audigent HaloID User Id System Module #5524

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 33 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
37ff4df
audigentRtdProvider
Jan 7, 2020
d06a522
fix line error
Mar 2, 2020
4473807
fix tests
Mar 3, 2020
d364fe6
deep equal test fix
Mar 3, 2020
baa7727
conditionally set data in html5 local storage, add markdown readme
Mar 3, 2020
35034a9
Merge remote-tracking branch 'upstream/master'
Mar 3, 2020
43a3e17
add integration test instructions to audigent readme
Mar 5, 2020
ef9c13d
Merge branch 'master' of github.com:AuDigent/Prebid.js
Jul 7, 2020
0907ff2
Merge remote-tracking branch 'upstream/master'
Jul 13, 2020
80d6adb
halo id update
Jul 15, 2020
cd940cb
add halo id to userid hpt example, submoduleparams check
Jul 21, 2020
1d12a8e
Merge remote-tracking branch 'upstream/master'
Jul 21, 2020
7e31e03
haloId submodule update
Aug 26, 2020
5eb93f2
remove script tag from haloid submodule
Sep 1, 2020
bb8c9a6
add eid tests
Sep 1, 2020
ae8ca22
update docs
Sep 1, 2020
15eea24
Merge remote-tracking branch 'upstream/master'
Sep 2, 2020
da79fde
merge upstream master
Sep 2, 2020
3e9e97a
name update
Sep 2, 2020
5046f55
url update, name update
Sep 2, 2020
abe9288
eid test update
Sep 2, 2020
c55b5de
remove getIds
Sep 2, 2020
f2d47c3
remove unused import
Sep 2, 2020
1750d99
style update
Sep 2, 2020
eddf1fc
remove erroneous chars
Sep 2, 2020
8fe6268
remove comments
Sep 8, 2020
f68f089
Merge remote-tracking branch 'upstream/master'
Sep 14, 2020
7cc169a
fix updated tests
Sep 14, 2020
ae1ea49
fix id count check placement
Sep 14, 2020
ff06174
style update
Sep 14, 2020
d145ceb
style update in eids.js
Sep 14, 2020
08b259a
trailing space fix
Sep 14, 2020
80b443e
documentation update
Sep 14, 2020
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
13 changes: 11 additions & 2 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,19 @@
name: "_li_pbid",
expires: 28
}
},
{
name: "zeotapIdPlus"
},
{
name: "zeotapIdPlus"
}],
name: 'haloId',
storage: {
type: "cookie",
name: "haloId",
expires: 28
}
}
],
syncDelay: 5000,
auctionDelay: 1000
}
Expand Down
4 changes: 3 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
"identityLinkIdSystem",
"sharedIdSystem",
"intentIqIdSystem",
"zeotapIdPlusIdSystem"
"zeotapIdPlusIdSystem",
"haloIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
"dfpAdServerVideo"
],
"rtdModule": [
"browsiRtdProvider",
"audigentRtdProvider",
"jwplayerRtdProvider"
]
}
63 changes: 63 additions & 0 deletions modules/haloIdSystem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* This module adds HaloID to the User ID module
* The {@link module:modules/userId} module is required
* @module modules/haloIdSystem
* @requires module:modules/userId
*/

import * as utils from '../src/utils.js';
import {ajax} from '../src/ajax.js';
import {submodule} from '../src/hook.js';

const MODULE_NAME = 'haloId';

/** @type {Submodule} */
export const haloIdSubmodule = {
/**
* used to link submodule with config
* @type {string}
*/
name: MODULE_NAME,
/**
* decode the stored id value for passing to bid requests
* @function
* @param {{value:string}} value
* @returns {{haloId:Object}}
*/
decode(value) {
return (value && typeof value['haloId'] === 'string') ? { 'haloId': value['haloId'] } : undefined;
},
/**
* performs action to obtain id and return a value in the callback's response argument
* @function
* @param {SubmoduleParams} [configParams]
* @returns {IdResponse|undefined}
*/
getId(configParams) {
const url = `https://id.halo.ad.gt/api/v1/pbhid`;

const resp = function (callback) {
const callbacks = {
success: response => {
let responseObj;
if (response) {
try {
responseObj = JSON.parse(response);
} catch (error) {
utils.logError(error);
}
}
callback(responseObj);
},
error: error => {
utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
callback();
}
};
ajax(url, callbacks, undefined, {method: 'GET'});
};
return {callback: resp};
}
};

submodule('userId', haloIdSubmodule);
32 changes: 32 additions & 0 deletions modules/haloIdSystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Audigent Halo User ID Submodule

Audigent Halo ID Module. For assistance setting up your module please contact us at [[email protected]]([email protected]).

### Prebid Params

Individual params may be set for the Audigent Halo ID Submodule. At least one identifier must be set in the params.

```
pbjs.setConfig({
usersync: {
userIds: [{
name: 'haloId',
storage: {
name: 'haloId',
type: 'html5'
}
}]
}
});
```
## Parameter Descriptions for the `usersync` Configuration Section
The below parameters apply only to the HaloID User ID Module integration.

| Param under usersync.userIds[] | Scope | Type | Description | Example |
| --- | --- | --- | --- | --- |
| name | Required | String | ID value for the HaloID module - `"haloId"` | `"haloId"` |
| storage | Required | Object | The publisher must specify the local storage in which to store the results of the call to get the user ID. This can be either cookie or HTML5 storage. | |
| storage.type | Required | String | This is where the results of the user ID will be stored. The recommended method is `localStorage` by specifying `html5`. | `"html5"` |
| storage.name | Required | String | The name of the cookie or html5 local storage where the user ID will be stored. | `"haloid"` |
| storage.expires | Optional | Integer | How long (in days) the user ID information will be stored. | `365` |
| value | Optional | Object | Used only if the page has a separate mechanism for storing the Halo ID. The value is an object containing the values to be sent to the adapters. In this scenario, no URL is called and nothing is added to local storage | `{"haloId": "eb33b0cb-8d35-4722-b9c0-1a31d4064888"}` |
8 changes: 8 additions & 0 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const USER_IDS_CONFIG = {
source: 'netid.de',
atype: 1
},

// sharedid
'sharedid': {
source: 'sharedid.org',
Expand All @@ -124,10 +125,17 @@ const USER_IDS_CONFIG = {
} : undefined;
}
},

// zeotapIdPlus
'IDP': {
source: 'zeotap.com',
atype: 1
},

// haloId
'haloId': {
source: 'audigent.com',
atype: 1
}
};

Expand Down
7 changes: 7 additions & 0 deletions modules/userId/eids.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,12 @@ userIdAsEids = [
atype: 1
}]
},
{
source: 'audigent.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
}
]
```
16 changes: 16 additions & 0 deletions test/spec/modules/eids_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ describe('eids array generation for known sub-modules', function() {
}]
});
});

it('zeotapIdPlus', function() {
const userId = {
IDP: 'some-random-id-value'
Expand All @@ -206,6 +207,21 @@ describe('eids array generation for known sub-modules', function() {
}]
});
});

it('haloId', function() {
const userId = {
haloId: 'some-random-id-value'
};
const newEids = createEidsArray(userId);
expect(newEids.length).to.equal(1);
expect(newEids[0]).to.deep.equal({
source: 'audigent.com',
uids: [{
id: 'some-random-id-value',
atype: 1
}]
});
});
});

describe('Negative case', function() {
Expand Down
Loading