Installation
Step 1: Add the Saltfish Player Script
Include the provided Saltfish Player JavaScript file in your website's HTML, typically before the closing </body>
tag.
Step 2: Initialize the Player
In your application's JavaScript, initialize the player using your unique API token. This should typically happen once when your application loads.
Step 3: Identify Your Users (Optional)
To track individual user progress and leverage analytics effectively, identify users when they log in or their identity becomes known.
Step 4: Launching Guided Tours (Playlists)
Trigger specific playlists based on user behavior, page visits, or specific events in your application.
4. Tracking Success: Events & Analytics
Saltfish Player emits events that your application can listen to, allowing you to track engagement or trigger other actions.
playlistStarted
: Fired when a playlist begins playing for the first time.playlistEnded
: Fired when a playlist is fully completed.stepStarted
: Fired when an individual step within a playlist begins playing.stepEnded
: Fired when an individual step within a playlist ends (either by completing or transitioning away).playerPaused
: Fired when the player transitions from a playing state to a paused state.playerResumed
: Fired when the player transitions from a paused state back to a playing state.playerMinimized
: Fired when the user minimizes the player interface.playerMaximized
: Fired when the user maximizes the player interface from a minimized state.
Key API Summary for Your Developers
saltfish.init(tokenOrConfig)
: Initializes the player.saltfish.identify(userId, userData)
: Associates player usage with a specific user.saltfish.startPlaylist(playlistId, options)
: Launches a specific guided tour.saltfish.on(eventName, callback)
: Listens for player events.saltfish.off(eventName, callback)
: Stops listening for events.saltfish.destroy()
: Shuts down the player and cleans up resources.
Last updated