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

Invibes Bid Adapter - cookies update & user sync #2512

Merged
merged 1 commit into from
May 23, 2018
Merged

Invibes Bid Adapter - cookies update & user sync #2512

merged 1 commit into from
May 23, 2018

Conversation

rcheptanariu
Copy link
Contributor

Type of change

  • Other

Description of change

Send & update cookies through user sync

Other information

This update should also fix the issue in the unit tests: #2339

Copy link
Contributor

@mike-chowla mike-chowla left a 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 || {};
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

@rcheptanariu rcheptanariu May 15, 2018

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.

@rcheptanariu
Copy link
Contributor Author

Hello, please let me know if there are any more questions :)

@mike-chowla mike-chowla merged commit ee0ff04 into prebid:master May 23, 2018
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants