Initialization Events
The Guides and Surveys script dispatches two DOM events during startup. Listen for these events on document to determine when the API is safe to call.
The script loads asynchronously, so calling API methods before the appropriate event has fired may result in errors. Wrap your API calls in an event listener to ensure the script has initialized.
usetiful:basicApiReady
Fires when the Guides and Surveys script has loaded and user identification methods are available. After this event, window.USETIFUL.user.setId(), window.USETIFUL.user.setTag(), and window.USETIFUL.user.setTags() can be called.
Use this event when you need to identify the user or set tags as early as possible, before the full API surface has initialized.
usetiful:fullApiReady
Fires when all APIs are ready and user progress data has been loaded from the server. After this event, the entire window.USETIFUL API surface is available, including tour, checklist, and survey methods.
Use this event when you need to interact with tours, checklists, or surveys, or when your logic depends on the user's progress data being available.