With code (requires developer)

Launching Saltfish playlists with code

Start playlists

Launch playlists by calling the startPlaylist function using the ID of the playlist you want to start. The playlist ID is found in the URL of the playlist.

  saltfish.startPlaylist('75a86a0a-5966-46fa-a793-613e22c50a9x', {
      once: true // User will only see this playlist once, even on subsequent visits
  });

Start playlists based on user behavior

Launch specific playlists based on user behavior, page visits, or specific events in your application.

// Example: Start onboarding tour for new users on their first visit to the dashboard
if (isNewUser && isOnDashboardPage) {
  saltfish.startPlaylist('13a86a0a-5966-46fa-a793-613e22c50a9x', {
      once: true // User will only see this playlist once, even on subsequent visits
  });
}

// Example: Show a playlist only once per user (requires identify() or identifyAnonymous() to be called first)
if (userHasBeenIdentified) {
  saltfish.startPlaylist('25a86a0a-5966-46fa-a793-613e22c50a9x', {
    once: true // User will only see this playlist once, even on subsequent visits
  });
}

// Example: Launch a feature tour when a user clicks a "Learn More" button
document.getElementById('learn-feature-x').addEventListener('click', () => {
  saltfish.startPlaylist('75a86a0a-5966-46fa-a793-613e22c50a9x');
});

Last updated