-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Invibes Bid Adapter - cookies update & user sync #2512
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've a got a couple of questions about the changes
}; | ||
} | ||
} | ||
}; | ||
|
||
registerBidder(spec); | ||
|
||
// some state info is required: cookie info, unique user visit id | ||
const topWin = getTopMostWindow(); | ||
let invibes = topWin.invibes = topWin.invibes || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for creating the invibes object on the top window and attaching some of the functions below to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The location is on the top window so that we don't initialize our local id on this page twice. The cookie info and the id are passed to the user sync function. Also the functions for cookies are reused inside the postMessage, so it made sense to just put them all inside the same object
} catch (e) { } | ||
} | ||
|
||
function acceptPostMessage(e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason the this message? It's not clear to me why the caller does take care of setting cookies, etc and why the code to do so is inside your Prebid adapter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user sync happens in the iframe, on a different domain than the initial page. We need to update our local id if the user sync was successful, so the only way to do this was with a postMessage from the iframe.
Hello, please let me know if there are any more questions :) |
Type of change
Description of change
Send & update cookies through user sync
Other information
This update should also fix the issue in the unit tests: #2339