Information for: DEVELOPERS   PARTNERS   SUPPORT

Experience Builder methods

The Personalization JavaScript API enables manipulation of Experience Builder through the window.AcquiaLiftPublicApi global namespace. This page describes the methods that are available for use, by function.

Handling the Experience Builder sidebar

Use the following methods to handle the Experience Builder sidebar:

Method

Description

activate

Activates Experience Builder for the user. If the user is currently signed in, using this method opens the sidebar—if not, it will trigger an authentication request.

deactivate

Deactivates the Experience Builder, which closes the sidebar and signs out the current user. It will leave the markup for the Experience Builder in the DOM for reactivation.

remove

Performs the deactivate process, and then removes the Experience Builder markup from the DOM.

Managing displayed data

Use the following methods to handle the information displayed by Experience Builder:

Method

Description

refresh

Refreshes the data displayed in an open instance of the Experience Builder. This can be helpful when using a custom application that modifies slots, or segments outside of the Experience Builder, and you want the Experience Builder to recognize the changes without forcing a refresh of the entire page. Optionally, you can specify an array of the types of data to refresh. The valid types are slot, rule, and segment.

Examples

To refresh all of the Experience Builder-related data on a page, use the following code:

window.AcquiaLiftPublicApi.refresh();

To trigger a refresh of the slot data, use code similar to the following:

window.AcquiaLiftPublicApi.refresh(['slot']);