-
Notifications
You must be signed in to change notification settings - Fork 466
Open
Description
Hello! It would be nice to be able to set a custom user id directly via attributes of the script tag used to load rybbit/script.js. This would be nice mainly because since Rybbit V2, script.js's main function is now async. This means that identification can't be done via script.onLoad -> rybbit.identify(userId) as rybbit is not always globally defined yet and it causes a race condition. Being able to pass the customUserId as an attribute would solve the problem.
Proposal:
- Add
customUserIdto ScriptConfig - Support
data-custom-user-idin parseScriptConfig - Change
storedUserIdin Tracker.loadUserId, to usethis.config.customUserIdand fallback tolocalStorage.getItem("rybbit-user-id")
If you are happy with the proposal above and the feature request I can go ahead and implement it. Let me know!
leneti, InsidersByte and Wessam-Abozeid
Metadata
Metadata
Assignees
Labels
No labels