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

Lotame id system domain update #6063

Closed
wants to merge 8 commits into from

Conversation

markaconrad
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Define method on userId example page so the page loads
A few enhancements to the Lotame Panorama Id System User Id module

Be sure to test the integration with your adserver using the Hello World sample page.

  • contact email of the adapter’s maintainer: mconrad@lotame.com
  • official adapter submission

Other information

@lgtm-com
Copy link

lgtm-com bot commented Dec 1, 2020

This pull request introduces 1 alert when merging 3447bcd into 6963bb3 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

Comment on lines +155 to +184
findCookieDomain: function (fullDomain) {
if (!storage.cookiesAreEnabled()) {
return fullDomain;
}

const domainParts = fullDomain.split('.');
if (domainParts.length == 2) {
return fullDomain;
}
let rootDomain;
let continueSearching;
let startIndex = -2;
const TEST_COOKIE_NAME = 'lotame_domain_check';
const TEST_COOKIE_VALUE = 'writeable';
do {
rootDomain = domainParts.slice(startIndex).join('.');
let expirationDate = new Date(
utils.timestamp() + 10 * 1000
).toUTCString();
storage.setCookie(TEST_COOKIE_NAME, TEST_COOKIE_VALUE, expirationDate, 'Lax', `${rootDomain}`, undefined);
const value = storage.getCookie(TEST_COOKIE_NAME, undefined);
if (value === TEST_COOKIE_VALUE) {
continueSearching = false;
} else {
startIndex += -1;
continueSearching = Math.abs(startIndex) <= domainParts.length;
}
} while (continueSearching);
return rootDomain;
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's at least one or two other id modules that are doing essentially the same thing -- finding the root domain at which to write the 1p cookie. what are people's thoughts on moving this to a method in utils or userId module that can be re-used rather than repeated in multiple modules?

cc @patmmccann @Fawke @jdwieland8282 @robertrmartinez @pycnvr

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smenzer Yes, I like your idea.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@idettman do you have thoughts here? is this something we can/should break out to be a common userid (or even common prebid global) method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you all thinking this should be done in context of this PR or separately?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it probably makes the most sense to break this out into a separate PR, then you can use this PR to apply it to the Lotame ID system

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I will give that shot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That part is attempted in #6124

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markaconrad thanks for putting in #6124! I assume once that goes through, you would remove this block and on line 206 below you'd use the user id function instead of this right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are welcome! Yes, that is the plan

@patmmccann
Copy link
Collaborator

This seems closely related to #5500 ; @idettman tried a couple different approaches there and might be most qualified to comment

@markaconrad
Copy link
Contributor Author

I'm going to close this out but will re-open with a couple more changes and the result of #6124

@markaconrad markaconrad closed this Jan 8, 2021
@markaconrad markaconrad deleted the lotameIdSystem_domainUpdate branch January 4, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants