Running personalization
Running web experiences and web experiments
While you're initializing the Engage SDK, you can decide whether to run web experiences and web experiments in your app. You can run web experiences and web experiments by setting the webPersonalization
attribute to true
in the settings object in the Engage.init()
function, on the client side of your app. This attribute is not available on the server side.
Rerunning web experiences and web experiments
When the Engage functionality first loads in your app with the webPersonalization
attribute set to true
in the settings object, web experiences and web experiments run once. The experiences and experiments don't automatically run again on the same page. This means that you'll need to rerun experiences and experiments in, for example, the following scenarios:
-
You want to run personalization multiple times on the same page, for example, after the user fills out a form field or clicks a button.
-
You have a single-page application (SPA), which consists of only one web document, and you want to run personalization when the user navigates between routes.
Using the Engage SDK, you can rerun web experiences and web experiments by using the Engage.triggerExperiences()
function.
Behavioral and transactional data in personalized content
Using the Engage SDK, you can collect and send behavioral and transactional data that occur inside a web experience or a web experiment. To achieve this, you need to call Engage functions inside your web experience or web experiment.
If you integrate using the Engage SDK script, you can call, for example, the Engage.pageView()
function inside your web experience or web experiment.
If you integrate using the Engage SDK package, you first need to expose the Engage functions to the window
object. You can expose them by assigning the return value of the Engage.init()
function to a new property on the window
object. For example, you can assign the return value to window.Engage.exposedFunctions
. You can then call, for example, the Engage.exposedFunctions.pageView()
function inside your web experience or web experiment.