Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Developing with Sitecore Personalize
Data privacy
Before you start sending data
Integrating with Sitecore Personalize
Stream API
Personalize API Flow execution
REST APIs
  • Sitecore Personalize for developers
  • Stream API
  • Sitecore Engage SDK reference
  • Functions
  • window.Engage.triggerExperiences()

window.Engage.triggerExperiences()

The triggerExperiences() function reruns every web experience and web experiment that's live in Sitecore Personalize. This function is particularly useful if you want to run personalization, for example:

  • In a multi-page application, on the same page in response to user input.

  • In a single-page application (SPA), when the user navigates between routes.

You can only use this function if you previously set the webPersonalization attribute to true in the settings object in the Engage.init() function, on the client side of your app.

Here's an example of how to use the triggerExperiences() function to make sure that web experiences and web experiments always run on the /contact route of a SPA app.

RequestResponse
import { init } from "@sitecore/engage";

let engage;

const loadEngage = async () => {
  engage = await init({
    // ...
    webPersonalization: true
  });

  // Make sure web experiences and web experiments always run in SPA apps:
  if (window.location.pathname.includes("/contact")) {
    window.Engage.triggerExperiences();
  }
};

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2025 Sitecore