fullstorydev / fullstory-browser-sdk

Official FullStory SDK for JavaScript, for web browsers
MIT License
55 stars 17 forks source link

Add window['_fs_ready'] callback #102

Closed aleksandergurin closed 2 years ago

aleksandergurin commented 3 years ago

In FullStory there is a useful callback that you can set window['_fs_ready'] = function() {};.

Why that callback is useful? There you can call FS.identify(uid, userVars?) to identify a user or you can get current session URL.

Some documentation:

luser commented 2 years ago

Hi there! Thanks for this PR, I'm sorry we haven't been very attentive to contributions on this repository. Unfortunately we can't make changes to src/snippet.js in this repository, as it's a generated file that's synced from elsewhere. I'm going to add some things to the repository to make that clearer to avoid this in the future.

Additionally, there's a newer API that has not yet been made generally-available that allows registering multiple listeners, similar to using window.addEventListener('load', …)instead of window.onload = …. In light of that, I'm going to close this PR and open a new issue for this functionality.