-
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
DeepIntent Id Module : fix user ids not being passed on page reload due to getValue func miss #11383
Conversation
the user id module should pull the ID from cache automatically if using the core id module to save it (as opposed to doing it manually); extendId should not be required unless you're trying to do something extra with the cached value on every page, which in this PR, it doesn't look like you're doing. so it seems like there's an issue with the page setup or something else is going on to cause the issue you're seeing. |
Thanks for your response, @smenzer. Unfortunately this does not look like a setup issue. I am able to replicate this locally as well. Here's how the flow works:
|
i think we probably need an engineer that knows the details of the module a bit better than myself (product manager) to help out here, @parthshah51999. i've requested that @dgirardi take a look to see if he can add some value. |
The issue is that storage is meant to be managed by Prebid. On the other hand, I am not able to find a developer's guide for userId modules, so it's not surprising that this generates confusion. This is the relevant piece of logic: Prebid.js/modules/userId/index.js Lines 769 to 791 in fadc303
In the "normal" flow, line 769 does not find anything in storage, In your case, an external script populates the cookie, but in a different way (stringified TL;DR how to fix? The "correct" way is to not use The easy fix is to update Prebid.js/modules/deepintentDpesIdSystem.js Lines 46 to 48 in fadc303
to
but note that this will still overwrite your cookie, so if you store anything else, or want to manage expiration, you'll still have problems. |
Hey @dgiradi, thanks this works. Also noted that the cookie value is consistently overwritten post the fix. We are okay with this for now and will follow up if we need to make additional updates. Quick question just for my understanding: |
It's true when:
|
Do you mind updating the unit tests? they are passing for all the wrong reasons: Prebid.js/test/spec/modules/deepintentDpesIdsystem_spec.js Lines 48 to 68 in 51bcf81
|
Hey @dgirardi, Yes the call happens only once. This led to more debugging from my end and it turns out to test a few things out I had explicitly called the refreshUserIds() function before the setConfig call from my test page. Apologies for the miss on my end, but the solution you suggested is not working out.
Does that make sense? Let me know in case I am missing something. |
You are right - my suggestion only works as long as you don't already have a cookie set. I think (a) technically the best solution, but what you have should also work. (I was worried that it would only work for eids and not the "legacy" |
I had implemented the extendId in the first iteration of this PR but this was suggested - #11383 (comment) I can update the PR if necessary to implement the extendId function. But if there is no downside you foresee with this change this seems okay to me as well. Let me know how to proceed here. |
This is OK, except for the tests - as I noted above, think most of the suite is not actually testing anything. |
Cool I will update the tests, thanks for your help! |
@dgirardi @ChrisHuie any specific reason this was not picked for the 8.47.0 release ? |
Don't believe this pr was approved when I released Wednesday morning but merging now so it is included with this week's release. |
…ue to getValue func miss (prebid#11383) * fix user ids not being passed on page reload due to extendId func miss * remove extendId and add function to read value for eids * handle inconsistent localstorage values in deepintent id * remove unused imports * revert to getValue changes * revert version in package-lock * update test suite for deepintent id system
…ue to getValue func miss (prebid#11383) * fix user ids not being passed on page reload due to extendId func miss * remove extendId and add function to read value for eids * handle inconsistent localstorage values in deepintent id * remove unused imports * revert to getValue changes * revert version in package-lock * update test suite for deepintent id system
…ue to getValue func miss (prebid#11383) * fix user ids not being passed on page reload due to extendId func miss * remove extendId and add function to read value for eids * handle inconsistent localstorage values in deepintent id * remove unused imports * revert to getValue changes * revert version in package-lock * update test suite for deepintent id system
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
Other information
On page reload, getId is not called from Id system submodule and it expects function extendId to provide the logic to read the id from storage. This is not implemented in deepintentDpesSubmodule which causes response Object to be blank. Because this is blank storedId doesn't get updated to response.id
local storage format: key : {"id": "123123"}