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

add digitrust function to utils #2859

Closed
bretg opened this issue Jul 18, 2018 · 3 comments
Closed

add digitrust function to utils #2859

bretg opened this issue Jul 18, 2018 · 3 comments
Labels

Comments

@bretg
Copy link
Collaborator

bretg commented Jul 18, 2018

Type of issue

cross-adapter utility library request

Description

DigiTrust is an optional module for pubs, but in order for adapters to support it, there's a small function that could be made a standard part of utils. This will save adapters from duplicating code.

Suggested code

Based on the code implemented in the Rubicon bid adapter:

exports.getDigiTrustQueryParams=function (defaultMemberId) {
  function getDigiTrustId(defaultMemberId) {
    let digiTrustUser = window.DigiTrust && (config.getConfig('digiTrustId') || window.DigiTrust.getUser({member: defaultMemberId}));
    return (digiTrustUser && digiTrustUser.success && digiTrustUser.identity) || null;
  }

  let digiTrustId = getDigiTrustId(defaultMemberId);
  // Verify there is an ID and this user has not opted out
  if (!digiTrustId || (digiTrustId.privacy && digiTrustId.privacy.optout)) {
    return [];
  }
  return {
    'dt.id': digiTrustId.id,
    'dt.keyv': digiTrustId.keyv,
    'dt.pref': 0
  };
}

Other information

Note that similar code is also used in the prebidServerBidAdapter

More info on DigiTrust at http://prebid.org/dev-docs/modules/digitrust.html

@mkendall07
Copy link
Member

can this just go into a module?

@bretg
Copy link
Collaborator Author

bretg commented Jul 19, 2018

The point of this utility function would be for simplified adapter support of the module. Each adapter needs to do the same things to look for DigiTrust config -- this makes it a one-liner for each.

Publishers still wouldn't be able to use DigiTrust without including the pseudo-module. Note that we don't currently have real module support for DigiTrust yet -- until their library is converted to an NPM package, which is on our list.

@mkendall07
Copy link
Member

closing this in favor of #3046
Bret I think we should figure out how to put this into a module still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants