Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
            • Engage.init(settings)
            • Engage.initServer(settings)
            • Engage.initServer.handleCookie(req, res)
            • Engage.getBrowserId()
            • Engage.getGuestId()
            • Engage.updatePointOfSale(pointOfSale)
            • Engage.pageView(eventData[, extensionData])
            • Engage.identity(eventData[, extensionData])
            • Engage.event(type, eventData[, extensionData])
            • Engage.addToEventQueue(type, eventData[, extensionData])
            • Engage.processEventQueue()
            • Engage.clearEventQueue()
            • EngageServer.pageView(eventData, req[, extensionData])
            • EngageServer.identity(eventData, req[, extensionData])
            • EngageServer.event(type, eventData, req[, extensionData])
            • window.Engage.triggerExperiences()
        • Troubleshooting
        • Release notes
  1. Functions
  1. Stream API
  2. Functions
  3. 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.

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();
  }
};
If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use