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

CriteoId User Module #4287

Merged
merged 4 commits into from
Nov 5, 2019
Merged

Conversation

Swiiip
Copy link
Contributor

@Swiiip Swiiip commented Oct 11, 2019

Add CriteoId User Module

Type of change

  • [x ] Feature

Description of change

This PR allows adapters to have access to a Criteo ID via the user module. It replaces the CriteoRTUS User Module currently available. We will remove it in a following PR and update adapters and documentation accordingly.

@jaiminpanchal27 jaiminpanchal27 self-assigned this Oct 11, 2019
@Swiiip Swiiip force-pushed the criteoId_module branch 3 times, most recently from cf3db2b to d4fafb5 Compare October 24, 2019 16:07
Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

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

@Swiiip Please see inline comments.
Also please submit a PR to the docs repo to list Criteo ID system here http://prebid.org/dev-docs/modules/userId.html. Thank you for contributing

const pastDateString = new Date(0).toString();
const expirationString = new Date(utils.timestamp() + cookiesMaxAge).toString();

function areCookiesWriteable() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cookiesAreEnabled function uses the window.navigator.cookieEnabled flag which returns true on Safari even on domains considered as trackers by ITP, which we would like to avoid. That's why we only rely on the read/write check.

return canWrite;
}

function extractProtocolHost (url, returnOnlyHost = false) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍, I kept the formatting part in the module, but the parsing part uses url.js function.

* @param {SubmoduleParams} [configParams]
* @returns {function(callback:function)}
*/
getId(configParams) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried this on hello_world page and it does not work. Here is the fiddle https://jsfiddle.net/t2c3nfq4/

Here jsdoc says it returns function but I see an object on line 134. On first call when there is nothing in localStorage/cookies, getId will return {'criteoId: undefined'}. User id module calls submodule.getId() from here https://github.com/prebid/Prebid.js/blob/master/modules/userId/index.js#L391 and here https://github.com/prebid/Prebid.js/blob/master/modules/userId/index.js#L418. Your response is not satisfying none of the scenarios.

Can you share a working test page ? More details here http://prebid.org/dev-docs/modules/userId.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the code from getId() and decode(id).
getId() returns an object {id: xxx} where xxx can either be an object {criteoId: <criteoId>} or undefined
decode(id) returns the id as-is

The jsfiddler should work now.

@Swiiip Swiiip marked this pull request as ready for review October 28, 2019 16:46
@Swiiip
Copy link
Contributor Author

Swiiip commented Oct 28, 2019

The updated doc for the Criteo ID module is available here: prebid/prebid.github.io#1575

@jaiminpanchal27
Copy link
Collaborator

@Swiiip Everything looks good. Just one more missing part.
Please add your filename here https://github.com/prebid/Prebid.js/blob/master/modules/.submodules.json so build system automatically pulls userId module when criteoIdSystem is included in build command.

And also pull master from upstream to resolve this conflict.

Thanks

@Swiiip Swiiip force-pushed the criteoId_module branch 3 times, most recently from 776e0fd to ca69371 Compare November 4, 2019 16:57
@pm-harshad-mane
Copy link
Contributor

Hello @Swiiip ,

CI job is failing, can you merge the upstream/master in your branch and try again? this may pass the CI job.

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a comment

Choose a reason for hiding this comment

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

LGTM

Hugo Duthil added 4 commits November 5, 2019 10:28
Changes:
- Use of url parsing function from url lib
- Update the return type of getId()
- Update the jsdoc to reflect the real return types
@jsnellbaker jsnellbaker merged commit 23c2eba into prebid:master Nov 5, 2019
@pm-harshad-mane
Copy link
Contributor

pm-harshad-mane commented Nov 5, 2019

Hello @Swiiip ,

Few questions for you,

  • As a bidder adapter, should we support both criteoId and criteoRtusId? criteortusIdSystem.js is still present in the master
  • For criteortus a bidders had to code like userId.criteortus.${BIDDER_CODE}.userid. For new criteoId userId.criteoId will work, right?
  • if a bidder is passing criteoid in ORTB format like prebidServerBidAdapter, what should be value for source paarameter? should it be criteo.com ? Refer Liveintent code here
    https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L733

@jaiminpanchal27, @jsnellbaker
Does Criteo need to add support for their id in prebidServerBidAdapter like LiveIntent, Parrable has added code? https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L733

@Swiiip
Copy link
Contributor Author

Swiiip commented Nov 6, 2019

Hello @pm-harshad-mane,

Thank you for your interest in this module.

  • As a bidder adapter, you should rather use the CriteoId module than the CriteoRTUS module. The latter is still supported but it is deprecated and is redundant with the CriteoId module. It will be removed soon from prebid.
  • You are right, to have a better uderstanding of the module, you can check the updated documentation currently in review here: Replace Criteo Rtus module doc with Criteo ID module doc prebid.github.io#1575.
  • I'm not familiar with this format/intergration and I'm not sure Criteo supports it for the moment, let me ask around and come back to you.

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.

4 participants