-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
37ff4df
audigentRtdProvider
d06a522
fix line error
4473807
fix tests
d364fe6
deep equal test fix
baa7727
conditionally set data in html5 local storage, add markdown readme
35034a9
Merge remote-tracking branch 'upstream/master'
43a3e17
add integration test instructions to audigent readme
ef9c13d
Merge branch 'master' of github.com:AuDigent/Prebid.js
0907ff2
Merge remote-tracking branch 'upstream/master'
80d6adb
halo id update
cd940cb
add halo id to userid hpt example, submoduleparams check
1d12a8e
Merge remote-tracking branch 'upstream/master'
7e31e03
haloId submodule update
5eb93f2
remove script tag from haloid submodule
bb8c9a6
add eid tests
ae8ca22
update docs
15eea24
Merge remote-tracking branch 'upstream/master'
da79fde
merge upstream master
3e9e97a
name update
5046f55
url update, name update
abe9288
eid test update
c55b5de
remove getIds
f2d47c3
remove unused import
1750d99
style update
eddf1fc
remove erroneous chars
8fe6268
remove comments
f68f089
Merge remote-tracking branch 'upstream/master'
7cc169a
fix updated tests
ae1ea49
fix id count check placement
ff06174
style update
d145ceb
style update in eids.js
08b259a
trailing space fix
80b443e
documentation update
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.