-
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
Force refresh userId #5683
Comments
We have been looking at an option to reinitialize analytics for SPAs particularly focused on tracking an approximation to "pages". It seems there is a cluster of information generally thought of as occuring on page load that should have a "reinitialization" hook. |
@jdwieland8282 - please take a look at this request and consider assigning if you agree with it |
Hi @TLadd, just want to make sure I understand this request. User ids available post page load, like ones derived from a login event, will be more persistent but are not available to the getId function bc, that function renders on page load. The request is to design a feature that "reinitialization's" User ids, post page load? |
@jdwieland8282 Yep, that's correct. The goal is to be able to refresh a userId value that gets sent with bids without having to refresh the page. Right now, it is technically possible to overwrite a user id value by directly accessing the cookie or key in localStorage dictated by the config. However, this will only be reflected in bids after a page reload, since the submodules are only initialized once on load, at which point the values are either read from the cookie/localStorage or So I'm hoping for a function that I can call to trigger reinitializing the userId value(s). In my proposed API, I suggested an For my particular need (and I imagine most), it would actually be fine to just re-run |
I think this request makes sense. Much like we refresh if consent changes, if there's another event that could improve the accuracy/value/etc of the IDs, there should be a way to update for future bid requests on the same page (or for future page loads, for that matter). A few things to consider:
|
Added an initial pull request for this feature. It's a simple global function that reinitializes all of the user modules, populating them will any changes from the storage/cookie. Please take a look if you are interested. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
not stale, PR is waiting on a 2nd review #5819 |
Closed by #5819 |
Type of issue
Feature Request
Description
I would like for there to be a way to force refresh userId values. Currently, if I update a stored userId value in a cookie or localStorage, that new value will get pulled in on future page loads, but not the current one. The old value remains since submodules only get initialized once, which is when these values are read.
The use cases I have where this would be useful all boil down to being able to provide a better id sometime after the initial page load. For instance, after a user logs in, I can get a better identifier than was previously stored and I want to start using it in bids without refreshing the page.
I would propose something along these lines:
The text was updated successfully, but these errors were encountered: